|
-
Jul 21st, 2008, 05:00 AM
#1
Thread Starter
New Member
Adodc refresh failed
Hi i am new to ActiveX and i get the following errors (with adodc1.Refresh highlighted):
syntax error in From Clause
Method 'Refresh' of object 'IAdodc' failed.
here's my code:
Private Sub txtname_Change()
adodc1.RecordSource = "Select * from tablecoy where coyname like '" & txtname.Text & "*'"
adodc1.Refresh
If txtname.Text = "" And txtcp.Text <> "" Then
adodc1.RecordSource = "Select * from tablecoy where cperson like '" & txtcp.Text & "*'"
adodc1.Refresh
Exit Sub
ElseIf txtname.Text <> "" And txtcp.Text <> "" Then
adodc1.RecordSource = "Select * from tablecoy where coyname like '" & txtname.Text & "*' and cperson like '" & txtcp.Text & "*'"
adodc1.Refresh
Exit Sub
ElseIf txtname.Text = "" And txtcp.Text = "" Then
adodc1.RecordSource = "Select * from tablecoy"
adodc1.Refresh
Exit Sub
End If
End Sub
what's wrong with my codes? pls help... thank you so much...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|