|
-
May 19th, 2005, 08:30 AM
#1
Thread Starter
Lively Member
Set Variable = query Result
I want to set a variable to equal the result from a database query.
ex:
VB Code:
selectSQL = "SELECT FirstName, LastName FROM Client;"
qResults = ConSource.Execute selectSQL
That should give you an idea of what im trying to do, Is this even possible?
Thanks,
Ryan
-
May 19th, 2005, 08:33 AM
#2
Re: Set Variable = query Result
Dim qResults as Recordset
set qResults = ConSource.openrecordset(selectSQL)
I think thats it (that may be for DAO though and not ADO...my ADO is rusty)
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
May 19th, 2005, 08:51 AM
#3
Thread Starter
Lively Member
Re: Set Variable = query Result
 Originally Posted by [LGS]Static
Dim qResults as Recordset
set qResults = ConSource.openrecordset(selectSQL)
I think thats it (that may be for DAO though and not ADO...my ADO is rusty)
Thanks for the quick reply,
But i forgot to mention i am using a DSN Connection.
Ryan
-
May 19th, 2005, 01:31 PM
#4
Thread Starter
Lively Member
Re: Set Variable = query Result
I tried this
VB Code:
Dim Query As rdoResultsets
SQL = "SELECT FirstName, LastName FROM client;"
Set Query = conSource.rdoResultsets(SQL)
But that doesnt seem to work either.
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
|