Error in connecting Datagrid with Ado in Form Load Event

Asked By 0 points N/A Posted on -
qa-featured

Hi,

I am facing a problem in connecting datagrid with ado, the problem occurs in form load event. To further elaborate my problem here is code snippet along with its error message.

Kind Regards,

SHARE
Answered By 0 points N/A #119651

Error in connecting Datagrid with Ado in Form Load Event

qa-featured

 

You must make sure that you don't open the recordset in the formload event.
 
You got an error that the member or the data method was not found. Maybe, you must try out not to open the recordset and modify some of the code in the image given below.
 
If Not tel_idx is Nothing Then
 
If tel_idx.State Then tel_idx.Close
 
End If
 
tel_idx.CursorLocation = adUseClient
 
Set tel_idx = con.Execute("SELECT * FROM tel_index where name= '" + Text17.Text + "';")
 
Set DataGrid2.DataSource = tel_idx
 
Try adding this.
 
Cheers.

Related Questions