PDA

Click to See Complete Forum and Search --> : SQL Question


turtle
Feb 14th, 2002, 02:58 PM
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

purusingh
Feb 15th, 2002, 06:04 AM
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