-
SQL Question
I have an SQL question....
I am doing an SQL query against a database and am trying to retrieve a value. Well how do I set that particular value to a variable.
FYI... I am using an SQL Server 2000 accessed by an ADO connection. I am trying to get the Payrate for a particular Machine.
Can anyone help.
If so... I appreciate the help.
Thank You
-
sql
dim conn as new connection
dim rs as new recordset
conn.open "provider.............."
rs.open "select payroll from table1 where......",conn
rs.movefirst
msgbox rs.fields(0).value
or you can store into variable
dim r as variant
r=rs.fields(0).value
msgbox r