Groups | Blog | Home
all groups > sql server programming > september 2003 >

sql server programming : Assigning Query results to a Variable


Gordo
9/19/2003 10:58:49 PM
Hello,

I would like to Execute this Select Statement...

SELECT MAX(VisitorID) FROM Visitors.

Is there any way to store the result directly into a VB variable??

lngVisitorID = ???

Thanks!!!

John Bell
9/20/2003 1:16:45 AM
Hi

This would normally require a record set and for you to assign it to the
variable from that.

You don't say what you are using to access the database, but if it's ADO
this may help

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsqlmag01/html/namedparameters.asp

John

[quoted text, click to view]

AddThis Social Bookmark Button