|
-
Oct 10th, 2000, 08:26 AM
#1
Thread Starter
Addicted Member
When I run this command:
Private Sub Command7_Click()
'CRI is the table name
'stock is the field name
mySQL = "SELECT * FROM cri WHERE stock Like '[89]*';"
Data1.RecordSource = mySQL
Data1.Refresh
End Sub
I am getting this error:
Too few parameters. Expected 1. (Error 3061)
What could be wrong with it...
Any help...
Appreciated in advance
[Edited by maqmaq on 10-10-2000 at 09:30 AM]
-
Oct 10th, 2000, 09:03 AM
#2
Lively Member
Originally posted by maqmaq
When I run this command:
Private Sub Command7_Click()
'CRI is the table name
'stock is the field name
mySQL = "SELECT * FROM cri WHERE stock Like '[89]*';"
Data1.RecordSource = mySQL
Data1.Refresh
End Sub
I am getting this error:
Too few parameters. Expected 1. (Error 3061)
What could be wrong with it...
Any help...
Appreciated in advance
[Edited by maqmaq on 10-10-2000 at 09:30 AM]
I would guess that it is the brackets, but I would suggest changing some other syntax:
strSQL="SELECT cri.* FROM cri WHERE cri.stock = 89;"
Unless you have a field named 'stock' that is a text field (WHY?) you cannot use "LIKE" as a comparison. 'LIKE' is a string comparison. Use simple arithmetic operators like "<>=". If you are using a string comparison for a field named "stock" (WHY?) then you should remove the brackets from around it. I think that the error that you are recieving is a type-mismatch error....but I have not looked it up.
Hope This Helps,
Hunter
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
|