|
-
Oct 19th, 2000, 03:45 PM
#1
Thread Starter
Junior Member
I need an SQL query that is implemented at run-time to do this:
SELECT Soldiers.SoldierID
FROM D:\syrpad\syrpad.Soldiers
WHERE (((Soldiers.SoldierNameLast)=Label5.caption));
What I mean is that it will give me back only the SoldierID of soldiers whose last name (SoldierNameLast) is equal to whatever the current content of Label5.caption is. Label5 is a standard VB label and it's caption value changes during the execution of the program.
When I try to run the above code, VB gives me an error:
"No value given for one or more required parameters"
When I do the same sql with a fixed value, however, it works fine:
SELECT Soldiers.SoldierID
FROM D:\syrpad\syrpad.Soldiers
WHERE (((Soldiers.SoldierNameLast)="Smith"));
--> returns SoldierIDs of soldiers whose last name is Smith.
I guess then that my problem is with how I am referring to the Label.caption in my SQL query. It is probably trying to look up the info in the database instead of in the program itself.
PLEASE HELP ME!!
Urgent!
Thanks
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
|