Recordset object is created in the same way as the Connection object and the Command object.
Type the following code in the frmAccountDetails form:
Private Sub Form_Load()
Set CN = New Connection
Set comobj = New Command
Set rs= new Recordset
With CN
.ConnectionString = “Integrated Security=SSPI;Initial Catalog=FinAccounting;Data Source=SYS1”
.Provider = “SQLOLEDB”
.Open
End With
With comobj
.ActiveConnection = CN
.CommandText = “SELECT * FROM AccountsTable”
End With
Set rs = comobj.Execute
End Sub
Filed under: visual basic | Tagged: creating recordset

Globe of Blogs
