Computing.Net > Forums > Programming > Error in Form Clause...?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Error in Form Clause...?

Reply to Message Icon

Name: Apple
Date: December 14, 2003 at 23:01:44 Pacific
OS: win98
CPU/Ram: 200
Comment:

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 write

connectString = "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 Sub

when 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.



Sponsored Link
Ads by Google

Response Number 1
Name: Stuart
Date: December 15, 2003 at 09:45:26 Pacific
Reply:

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


0
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Error in Form Clause...?

Logical error in Modul www.computing.net/answers/programming/logical-error-in-modul/6174.html

I have errors in my code www.computing.net/answers/programming/i-have-errors-in-my-code/14227.html

VB Errors in MS Office www.computing.net/answers/programming/vb-errors-in-ms-office/9439.html