Thursday, 20 September 2012

Zig Zag Effect on text and image using MARQUEE


Marquee is a  HTML tag which is use scroll object inseide it.
You can scroll any thing in body of marquee. Marquee tag has property direction which moves
and object(left,right,up,down) , Behavior property change behavior of scrolling.....
You can put image instead of <h1> or any thing which you want to move in a zigzag way... Enjoy marquee.

Girfa : Student Help

<marquee behavior=alternate>
        <marquee direction=down behavior=alternate>
            <marquee direction=up behavior=alternate>
                <h1>Girfa : Student Help</h1>
            </marquee>
        </marquee>       
   </marquee>

Database connectivity with MS Access in VB 6.0


Database connection with VB 6.0
VB provides a rich set of of database connectivety.Most of work which is needed done by aotomatically.There’re some control which provides database connectivety.Here i’m going to implement it using ADODB.
ADODB provides connection class.which handle insert ADODB,update,delete operation efficiently.
Ø       Make an objet of ADODB,Connection
Ø       Then call open function which takes connection string as argument
Ø       Connection string comprise database enzine name and your database path.I have supply relative path my database is in current folder.


Maked by Raj kumar

Controls :
    ( Three label,,Three Moniter,Three  textbox )

Coding

Dim con As New ADODB.Connection

Private Sub btnDelete_Click()
    If txtRoll.Text = "" Then
        MsgBox "Please enter roll no."
        txtRoll.SetFocus
    Else
        If MsgBox("Are you sure to delete this record", vbYesNo, "Girfa") = vbYes Then
            con.BeginTrans
            con.Execute "delete from stu where roll=" & txtRoll.Text
            con.CommitTrans
            txtRoll.Text = ""
            MsgBox "Record deleted"
        End If
        
    End If
End Sub

Private Sub btnSave_Click()
    If txtRoll.Text = "" Or txtName.Text = "" Or txtCity.Text = "" Then
        MsgBox "Please Fill alll field"
    Else
        con.BeginTrans
        con.Execute "insert into stu values(" & txtRoll.Text & ",'" & txtName.Text & "','" & txtCity.Text & "')"
        con.CommitTrans
        MsgBox "Saved", , "Girfa"
        
    End If
End Sub

Private Sub btnUpdate_Click()
    If txtRoll.Text = "" Or txtName.Text = "" Or txtCity.Text = "" Then
        MsgBox "Please enter all field value"
    Else
        con.BeginTrans
        con.Execute "update stu set name='" & txtName.Text & "',city='" & txtCity.Text & "' where roll=" & txtRoll.Text
        con.CommitTrans
        MsgBox "Record has been updated", , "Girfa"
    End If
End Sub

Private Sub Form_Load()
    con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=bsw.mdb;Persist Security Info=False"
End Sub



Wednesday, 19 September 2012

How to Print New Line in VB 6.0 Message Box


Message box is form which is use to print a message
by default its print text in same line
but you print your text in new line...... howz????
take a look..........
Private Sub Command1_Click()
    MsgBox "    Girfa " & vbCrLf & "Student Help", , "Girfa"
End Sub


Timer Using Java Script


We use timer control in VB6.0 ,VB.Net's window application.You can implement it in your web page using
java script.

Setting a timeout is done using the window’s setTimeout() method. This method accepts two arguments:
the code to execute and the number of milliseconds (1/1000 of a second) to wait before executing it. The
first argument can either be a string of code (as would be used with the eval() function) or a pointer to a
function. For example, both these lines display an alert after one second:



When you call setTimeout(), it creates a numeric timeout ID, which is similar to a process ID in an
operating system. The timeout ID is essentially an identifier for the delayed process should you decide,
after calling setTimeout(), that the code shouldn’t be executed. To cancel a pending timeout, use the
clearTimeout() method and pass in the timeout ID:



<html >
<head >
    <title>Girfa Timer Demo</title>
    <script language=javascript>
        var i=0;
        var id;
        function sstart()
        {
            var ob=document.getElementById('s1');
            i++;
            ob.innerHTML=i;
            id=setTimeout("sstart()",1000);          
        }
        function tstop()
        {
         
          clearTimeout(id);
         
        }
        function tstart()
        {
            setTimeout("sstart()",1000);
        }
    </script>
 
</head>
<body onload="sstart()">
    <form>
             <span id="s1" style="font-size:x-large">0:0:0</span>
            <input type=button value="start" onclick="tstart()" />
            <input type=button value="stop" onclick="tstop()" />
    </form>
</body>
</html>