|
-
Aug 4th, 1999, 03:12 PM
#1
Thread Starter
Member
Hi, Anyone can help me with this problem?
Currently I'm using ADODC connecting to access. But When i key in the following SQL text, I encounter some problem when i tried both of them, Pls guide me.
Ven - table name
Field1 - Row
(Tried) Code:
Select * FROM Ven WHERE Ven.Field1= "'& Text3.Text & '"
Select * FROM Ven WHERE Field1 = "'& Text3.Text & '"
Both can't work, Is the quotes right?
double quotes comes first then single quote ???
Or is there any another way??
Thks & regards.
-
Aug 4th, 1999, 05:19 PM
#2
Lively Member
Hi,
"Select * FROM Ven WHERE Ven.Field1='" & Text3.Text & "'"
[Double Quote]Select * FROM Ven WHERE Ven.Field1=[Single Quote][Double Quote][Space]&[Space]Text3.Text[Space]&[Space][Double Quote][Single Quote][Double Quote]
Hope this helps,
Preeti
-
Aug 5th, 1999, 09:13 AM
#3
Member
You'll make your life a lot easier if you stop using single quotes altogether. Use chr(34) instead like:
"SELECT tbl.Fld1 FROM tbl WHERE tbl.Fld2 = " & chr(34) & sCriteria & chr(34)
or
"SELECT tbl.Fld1 FROM tbl WHERE tbl.Fld2 LIKE " & chr(34) & sCriteria & "*" & chr(34)
Now you can forget adding double-doublequotes and accidental double-singlequotes plus you can let users put single and double quotes in the actual text of the fields and they can search with single and double quotes included in the criteria.
Justa thought
-S
------------------
http://www.smithvoice.com/vbfun.htm
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
|