Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Procedure which uses DAO to print all values in a ...
Website:
http://www.a1vbcode.com/
Submitted:
2/6/2000
Version:
VB3
Compatibility:
VB3,4,5
Category:
Databases
Views:
12357
Procedure which uses DAO to print all values in a recorset .
Declarations:
none
Code:
Sub PrintRec(strPath,Source) 'strPath is the path to the database 'Source is the source of the recordset. It could be a table or SQL query. Dim dbs As Database, tdf As TableDef Dim rst As Recordset, fld As Field Set dbs = OpenDatabase(strPath) Set rst = dbs.OpenRecordset(Source) With rst Do While NOT .EOF 'Iterate through fields collection For Each fld In rst.Fields 'Print results to debug window Debug.Print fld.Name, fld.Value Next fld 'next record .MoveNext Loop Debug.Print End With 'close objects rst.Close Set rst = Nothing dbs.Close Set dbs = Nothing End Sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement