|
-
October 25th, 1999, 08:37 PM
#1
How do I know the number of columns in Access database using Visual Basic programming
Can anyone please tell how to count the number of COLUMNS in Access database by using Visual Basic programming? Thank you.
-
October 26th, 1999, 01:34 AM
#2
Re: How do I know the number of columns in Access database using Visual Basic programming
Try this
Change the names of mdb and table names.
Dim db As Database
Dim rs As Recordset
Set db = opendatabase("C:\Program Files\MSOFFICE\access\Samples\northwind.mdb")
Set rs = db.OpenRecordset("select * from customers", dbOpenSnapshot)
MsgBox CStr(rs.Fields.Count)
rs.Close
db.Close
-
October 26th, 1999, 02:09 AM
#3
Re: How do I know the number of columns in Access database using Visual Basic programming
you can inspect the TableDefs collection of the database object in DAO and query the fields.count property.
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
|