|
-
May 22nd, 2006, 01:29 AM
#1
Thread Starter
Addicted Member
DB SElection Problem
VB Code:
strSerialNo = "2"
set rsmulti = dbname2.OpenRecordSet("SELECT * FROM Phrase2 where SerialNo = " & strSerialNo & " ",dbOpenDynaset)
can anyone tell me whats wrong with this function ? it cant work
-
May 22nd, 2006, 06:16 AM
#2
Re: DB SElection Problem
It always helps to state what is going wrong rather than just stating it doesn't work.
What happens when you run this? Are you getting an error? If so, what does the error say?
It looks like you are using a string variable. Strings need to be encapsulated in single quotes when used in querys.
VB Code:
"SELECT * FROM Phrase2 where SerialNo = '" & strSerialNo & "' "
-
May 22nd, 2006, 08:05 PM
#3
Thread Starter
Addicted Member
Re: DB SElection Problem
erm it got some errors like....data type mismatch in criteria expression
-
May 22nd, 2006, 08:15 PM
#4
Re: DB SElection Problem
string variables should be specified within single quotes.
Check it out:
strSerialNo = "2"
set rsmulti = dbname2.OpenRecordSet("SELECT * FROM Phrase2 where SerialNo = '" & strSerialNo & "' ",dbOpenDynaset)
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
|