|
-
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...
-
Jul 31st, 2008, 11:05 AM
#2
Re: Adodc refresh failed
Hi cheril0721, and welcome to the forums
Does this happen on every line which has a where clause by any chance, or upon every one of those refreshes including the simple select * from?
Are you using Access as your database source? (I'm wondering whether you need to use a % symbol rather than a * symbol in my asking this part).
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
|