Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Iam using ADO & i want to show my data in Grid using Microsoft DataGrid
Control 6.0 (OLEDB) & Microsoft ADO DataControl 6.0 (OLEDB). For this purpose i use a
text box (Change Event) & when i write the Rollno of the Student in it to show the result on the Grid.
Note that i use DSN Less connection in my application.In Adodc1 property i.e ConnectionString i writeconnectString = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=D:\school.mdb"
Private Sub Text1_Change()
Adodc1.RecordSource = "SELECT * FROM School where Rollno LIKE '" & Text1.Text & "%'"
Adodc1.Refresh
DataGrid1.Refresh
End Subwhen i write Rollno in text1 (Change Event) suppose 1 in it,it declase an error i.e
"Systex Error in Form Clase"
and then
Run Time Error '-2147217900 (80040e14)
Method 'Refresh' or Object '1Adodc' Failed
Please tell me how can i fix my problemWhat is the syxtex error in my Form Clase.
The database iam using is Access97.

It the % that is causing the problem. Remove it and it will work.
However, it looks like you are trying to force the value of Text1.text to an integer.
If this is the case then use:
Adodc1.RecordSource = "SELECT * FROM School where Rollno LIKE '" & Cint(Text1.Text) & "'"
If you are trying to add a % onto the value of text12.text use:
Adodc1.RecordSource = "SELECT * FROM School where Rollno LIKE '" & Text1.TEXT & "%"'"
Stuart

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |