|
-
Oct 19th, 2000, 04:22 AM
#1
Thread Starter
New Member
Hi,
i would like to extract the first record of a data base (in Oracle, or access or sql server) with a query in visual baic 6, but i don't want use counter or similar. How can i do?
thanks in advance
-
Oct 19th, 2000, 06:58 AM
#2
Lively Member
Try this:
Dim dbsDatabase as Database
Dim rstRecordset as Recordset
Set dbsDatabase = OpenDatabase "Full Path Here", False
Set rstRecordset = "Select Query Here"
rstRecordset.MoveFirst
That should place you in the first record of your recordset.
If you want to extract individual fields then just use something like this:
Dim strField0 as string
strField0 = rstRecordset(0)
0 is the first column in the recordset, if you want other columns then just substitute 0 for 1 and so on.
Hope this helps.
Best regards,
Rob Brown.
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
|