i need to connect the data grid to access db using ado code and vb6
(without using adodc control)and diplay the result of a select statemet on it
and here is the code that i am using
(it give me a run time errorr 3705 : the operation is not allowed when the object is open)
/in the module
Global con As New Connection
Global tel_idx As New Recordset
/in the form load event
con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Telephone_Index\Telephone_Index.mdb"
tel_idx.Open "tel_index", con, adOpenDynamic, adLockOptimistic
/in the command button click event
Set tel_idx = con.Execute("SELECT * FROM tel_index where name= '" + Text17.Text + "';")
tel_idx.CursorLocation = adUseClient
Set DataGrid2.DataSource = tel_idx