B
bailey.matt
Hey,
While wandering about one day writing some VB code, I came across an
ugly little error, as seen above. Further delving into my code tosee
whether I am a complete and utter fool, I managed to track downthis
ugly little error's source, which is as follows:
aComm.CommandText = "SELECT Cust_No, Cust_Name " & _
"FROM Customers " & _
"WHERE LOWER(Cust_Name) LIKE " &
txtName.Text.ToLower() & _
" + '*' OR LOWER(Cust_City) LIKE " &
txtCity.Text.ToLower() & _
" + '*' OR LOWER(Cust_Prov) LIKE " &
txtProv.Text.ToLower & "+ '*'"
This little bad boy is causing the executeReader() method of the
command object to throw the aformentioned error. I am using an Access
database to run this query against, and putting the data collected into
a list box. I tried running the query without the WHERE clause from my
procedure, and it ran. The query runs in Access with the WHERE,
however, it won't run from here.
If anyone has an idea, that would be super duper.
Cheers,
Matt Bailey
While wandering about one day writing some VB code, I came across an
ugly little error, as seen above. Further delving into my code tosee
whether I am a complete and utter fool, I managed to track downthis
ugly little error's source, which is as follows:
aComm.CommandText = "SELECT Cust_No, Cust_Name " & _
"FROM Customers " & _
"WHERE LOWER(Cust_Name) LIKE " &
txtName.Text.ToLower() & _
" + '*' OR LOWER(Cust_City) LIKE " &
txtCity.Text.ToLower() & _
" + '*' OR LOWER(Cust_Prov) LIKE " &
txtProv.Text.ToLower & "+ '*'"
This little bad boy is causing the executeReader() method of the
command object to throw the aformentioned error. I am using an Access
database to run this query against, and putting the data collected into
a list box. I tried running the query without the WHERE clause from my
procedure, and it ran. The query runs in Access with the WHERE,
however, it won't run from here.
If anyone has an idea, that would be super duper.
Cheers,
Matt Bailey