Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Link a Form with SQL Server Table with Code 1

Status
Not open for further replies.

7025

Programmer
Jan 13, 2005
3
ID
How can i create an open recordset for the form in vb6 ? (i want to open it with CODE, if with ADODC object i already know how it works). I already open the connection with the database. Is there any one can help me?
 
This example should give you the basic idea, you will need to change the property values to meet your needs (probably).

Code:
    Dim lrs As ADODB.Recordset
    
    Set lrs = New ADODB.Recordset
    With lrs
        Set .ActiveConnection = MyConnection
        .CursorType = adOpenForwardOnly
        .CursorLocation = adUseClient
        .LockType = adLockReadOnly
        .Open "SELECT * FROM MyTable"
    End With
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top