Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21324

[RESOLVED] Variables in quotes

$
0
0
Hello,

I am trying to use database connectivity in vb6 but am stuck at a step.

Now suppose, I consider this code:
Code:

rs.Open "select * from Table where Fld = 'Samp'"
This appears to work pretty well.

However, when I want the value of 'Fld' to be extracted from a text box.

It should be something like:
Code:

rs.Open "select * from Table where Fld = txtAbcd.text"
What is the right placement of single quotes (' ') in the above code as it does not work. ( I know the reason why as txtAbcd.text is in double quotes and wont yield the value in the text box). So I will need to use single quotes as well as either the & or the + operator. What is the correct way of writing the above code?


Please help

Ashwin

Viewing all articles
Browse latest Browse all 21324

Trending Articles