Hi,
I am using VB.6 for developing an application program and come across with the folloing SQL statement that works properly .
rs.open"SELECT Count(tblcontro l.id) As [CounR] FROM tblcontrol WHERE
tblcontrol.id = ' 0012 ' AND tblcontrol.cdna me = ' A' ;", cn,adOpenDynami c,adLockOptimis tic.
But, I cannot make, any values for the criteria, is given from the user . As in
Suppose:
X= txt1.Text
Y=txt2.Text
How can I concatnate the two variables with in the sql statement.
Example:
rs.open"SELECT Count(tblcontro l.id) As [CounR] FROM tblcontrol WHERE
tblcontrol.id = ' X ' AND tblcontrol.cdna me = 'Y' ;", cn,adOpenDynami c,adLockOptimis tic.
I am using VB.6 for developing an application program and come across with the folloing SQL statement that works properly .
rs.open"SELECT Count(tblcontro l.id) As [CounR] FROM tblcontrol WHERE
tblcontrol.id = ' 0012 ' AND tblcontrol.cdna me = ' A' ;", cn,adOpenDynami c,adLockOptimis tic.
But, I cannot make, any values for the criteria, is given from the user . As in
Suppose:
X= txt1.Text
Y=txt2.Text
How can I concatnate the two variables with in the sql statement.
Example:
rs.open"SELECT Count(tblcontro l.id) As [CounR] FROM tblcontrol WHERE
tblcontrol.id = ' X ' AND tblcontrol.cdna me = 'Y' ;", cn,adOpenDynami c,adLockOptimis tic.
Comment