-
Hi Guys,
I need an explanation...
When I run this query:
"select name from tbl where ID = 2"
it gives me an output.
Now, when I do this:
Dim x as integer
x=2
"select name from tbl where ID=x"
I get an error saying "Too few parameters. Required 1"
Any help will be appreciated
-
"select name from tbl where ID=x" isn't telling vb to use the variable x. You need to do it this way to make that happen:
"select name from tbl where ID=" & x
-
if your variable 'x' is a string then it needs to be:
"select name from tbl where ID='" & x & "'"