|
-
Jun 23rd, 2006, 11:44 AM
#1
Thread Starter
Addicted Member
how to cast a string value if there is ' in it?
hi,
I'm trying to pass a value to a sql query and it heppened to have ' in it and sql is complaining. I casted to string type but still does. here is my sql string:
---------------------------------
dim proname as string
proname = cStr(sheet1.cbox1.value)
SELECT *
FROM tblEmpl
Where ProjName = '" & proname & "'
----------------------------------
this works perfect if there is no ' in the value passed.
FYI. I'm using VBA with Sql server
thanks for any sugetsions
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
|