|
-
Sep 11th, 2001, 05:08 AM
#1
Thread Starter
New Member
Handling Executed Queries
Hey All,
I'm writing a VB App at the moment on a bit of a learning curve for my own benefit and have made a Mock Up Database and used the "DataEnviroment" to connect to it. I have done this all find and used the SQL Builder to make a query on the database and that worked great!
One problem reside's.
How can I get it so I can store the retrieved information to a variable or be written to another source? I know this is definately not one for the pros, and mock me if you like but it is of great inportence to find this out.
Thankyou in advance for any help that is given,
Jester
-
Sep 11th, 2001, 05:21 AM
#2
Well ...
I think what you need is recordsets. Check out some ADO tutorials, MSDN help and the database section on this forum to learn more about it.
.
-
Sep 12th, 2001, 06:36 PM
#3
PowerPoster
Following should help you. Once the query is performed then get the results as follows:
VB Code:
Sub Selected(qdfTemp As QueryDef)
Dim rsTemp As Recordset
Set rsTemp = qdfTemp.OpenRecordset(dbOpenForwardOnly)
'Enumerate recordset for found records
With rsTemp
Do While Not .EOF
'Get Values and assign to variables
lngYourVariable = !fldName 'Used in Your SELECT
.MoveNext
Loop
End With
rsTemp.Close
Set rsTemp = Nothing
End Sub
-
Sep 12th, 2001, 08:36 PM
#4
Thread Starter
New Member
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
|