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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help in Assigning SQL Values

Status
Not open for further replies.

Cap2010

Programmer
Mar 29, 2000
196
CA
HI,

I want to the value from the below statement

select count(party_id) from Master

assigned to a variable. so that I can
use for do while condition.

Will this do

dim vCount as variant

vCount = cn.Execute ("select count(party_id) from Master")

Really will solve much of my problems.

Lad
 
It would make it easier for you if you did the following


Change your code to read


dim vCount as variant
dim oRs as adodb.recordset

'Create an alias that can be referenced in the recordset object returned from the execute statement

set oRs = cn.Execute ("select count(party_id) as Count_PartyID from Master")

vCount = oRS.Fields("Count_PartyID").value

Hope this Helps




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top