Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have a select statement that narr

Status
Not open for further replies.

skispray

Programmer
Feb 28, 2003
16
US
I have a select statement that narrows the records down to one (ex. A UserID). Something that I want out of that row is to set the variable strFirstName to the value in the "FirstName" column in my record. How do I do that?
 
skis: I would select "FirstName" in the SELECT statement and then pick up the value when you execute your reader; one possibility..e.g.,

SELECT ..., ..., "FirstName" FROM tbl...

and when you execute the reader pick up the value:

Dim strFirstName As String
reader = DBCommand.ExecuteReader()
While reader.Read()
....
strFirstName = reader("FirstName")
Acme.Text = reader("Acme")
...
End While
reader.Close()

...just a thought.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top