|
-
Apr 3rd, 2000, 06:30 AM
#1
Thread Starter
Junior Member
I am writing a program for class, and it requires that we write and SQL SELECT statement. I thought I typed it in correctly, but the computer thinks otherwise. I get an error 3141 - The select statement includes a reserved word or an argument name that is either missing or mispelled, or the puncutation is incorrect. Here is what my code looks like. intCustomer is the customerid number entered earlier in program by user:
pstrFROM = " FROM tblCustomer"
pstrWHERE = " WHERE fldCustomerID = " & "'" & intCustomerNumber & "'"
psqlSelect = "SELECT" & pstrFROM & pstrWHERE
Set gdbMentorRecords = _
Module1.gdbMentor.OpenRecordset(psqlSelect)
Any help would greatly appreciated!
Thanks
Rachael
-
Apr 3rd, 2000, 06:44 AM
#2
Member
After your SELECT statement, you need to specify some criteria.
Example:
SELECT * FROM yourtablename or
SELECT name, address, phone FROM yourtablename
In your case, your SQL statement has no criteria. It looks like this:
SELECT FROM tblCustomer WHERE........
So the program doesn't know *WHAT* you want to select!
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
|