Experts Exchange connects you with the people and services you need so you can get back to work.
Improve company productivity with a Business Account.Sign Up
Private Sub Command1_Click()
Dim strConnection As String
Dim cn As New ADODB.Connection
Dim cat As New ADOX.Catalog
Dim rs As New ADODB.Recordset
Dim r As Long
Dim strDatabasePath As String
strDatabasePath = "C:\MyFolder\MyDatabase.mdb"
Const TableName = "MyTable"
strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDatabasePath & ";Persist Security Info=False"
cat.ActiveConnection = strConnection
MsgBox "Field Count = " & cat.Tables(TableName).Columns.Count
rs.Open TableName, cn, adOpenDynamic, adLockPessimistic, adCmdTable
Do Until rs.EOF
r = r + 1
MsgBox "Record count =" & r
Open in new window
Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.