|
-
October 11th, 2001, 07:51 AM
#1
Database Variable Problems
i need to assign variables from a recordset called from an SQL statement but i can't figure out how to change the Field Name bit to a variable .... i've tried all sorts of bracket combinations, etc but to no avail. is this possible at all?
EG:
VarToBeAssigned = RstRecordSet![NeedToHaveVarInHere]
-
October 11th, 2001, 08:06 AM
#2
Re: Database Variable Problems
Try:
VarToBeAssigned = RstRecordSet![<FIELD_NAME in database>]
-
October 11th, 2001, 08:07 AM
#3
Re: Database Variable Problems
are you looking for this?
dim varFieldName as string
varFieldName= "A_field_name"
varToBeAssigned= rsRecordset(varFieldName).value
Warning: the recordset maybe a null value, so
varToBeAssigned better be variant!
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Michael
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
October 11th, 2001, 08:12 AM
#4
Re: Database Variable Problems
thanks a lot ... it was the .value bit that i was missing to sort that out
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|