Can I use variables in SQL command?

LSW
04-18-2004, 09:36 AM
Hi there,
I am using an SQL command to search for data using two fields. Below is my code:

DataControl.RecordSource = "select * from TestQuesBank where TestId=2 AND TestNo=numArr(counter)"

numArr(counter) is the variable (array) that I want to use as a searching criteria, besides the integer "2", as can be seen on my code. I got an error message saying that numArr is undefined. Does this mean that I could not use variables in SQL command? How do I solve this? Thank you so much! :p

Shurik12
04-18-2004, 09:38 AM
Hi,



"select * from TestQuesBank where TestId=2 AND TestNo= " & numArr(counter) & ""


Shurik.

LSW
04-19-2004, 01:37 AM
Thank you so much, Shurik! ;)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum