Hi,
I have an application in VB 6. Users log to a Ms Access database, then I keep in a hidden form the name of the user.
Also I have the following code in a form where I the only object I have is a datagrid (datagrid1) and nothing else.
*****************************************
Private Sub Form_Load()
Dim ADOconnection As ADODB.Connection
Dim ADOrst As ADODB.Recordset
Dim connectString As String
Set ADOconnection = New ADODB.Connection
Set ADOrst = New ADODB.Recordset
connectString = "Provider=Microsoft.Jet.OLEDB.3.51;" _
& "Data source=c:\mydatabase.mdb"
ADOconnection.Open connectString
ADOrst.Open "SELECT MYNAME, MYSURNAME, MYJOB, MYDEPT, MYOFFICE, MYTF FROM TABLE1, TABLE2 WHERE MYNAME = '" & frmtrack.txtmydept & "'", ADOconnection
Now when I do ...
DataGrid1.DataSource = ADOrst
... and run the application, it gives me the compile error "Method or data not found"
and it refers to Datasource in such line.
*******************************************
What is the problem?
Thanks in advance!
Klasse
I have an application in VB 6. Users log to a Ms Access database, then I keep in a hidden form the name of the user.
Also I have the following code in a form where I the only object I have is a datagrid (datagrid1) and nothing else.
*****************************************
Private Sub Form_Load()
Dim ADOconnection As ADODB.Connection
Dim ADOrst As ADODB.Recordset
Dim connectString As String
Set ADOconnection = New ADODB.Connection
Set ADOrst = New ADODB.Recordset
connectString = "Provider=Microsoft.Jet.OLEDB.3.51;" _
& "Data source=c:\mydatabase.mdb"
ADOconnection.Open connectString
ADOrst.Open "SELECT MYNAME, MYSURNAME, MYJOB, MYDEPT, MYOFFICE, MYTF FROM TABLE1, TABLE2 WHERE MYNAME = '" & frmtrack.txtmydept & "'", ADOconnection
Now when I do ...
DataGrid1.DataSource = ADOrst
... and run the application, it gives me the compile error "Method or data not found"
and it refers to Datasource in such line.
*******************************************
What is the problem?
Thanks in advance!
Klasse