This is my code.
Private Sub btnRunQuery_Click()
Dim dbs As Database, rst As Recordset
' Modify this line to include the path to Northwind
' on your computer.
Set dbs = OpenDatabase("C:\AccessDB-equinoxserver\Equinoxserver.mdb"
' Count the number of records with a PostalCode
' value and return the total in the Tally field.
Set rst = dbs.OpenRecordset("SELECT Count " _
& "(copName) As Tally FROM dbo_tblContProj;"
' Populate the Recordset.
rst.MoveLast
With rst
Do While Not .EOF
Debug.Print "Contents of recordset #" & intCount
Debug.Print , .Fields(0), .Fields(1), .Fields(2)
.MoveNext
intCount = intCount + 1
Loop
End With
dbs.Close
End Sub
I dont have any errors but for some reason the debug.print statements are not working. Is it possible that this is shut off somewhere.
Any help would be appreciated.
Private Sub btnRunQuery_Click()
Dim dbs As Database, rst As Recordset
' Modify this line to include the path to Northwind
' on your computer.
Set dbs = OpenDatabase("C:\AccessDB-equinoxserver\Equinoxserver.mdb"
' Count the number of records with a PostalCode
' value and return the total in the Tally field.
Set rst = dbs.OpenRecordset("SELECT Count " _
& "(copName) As Tally FROM dbo_tblContProj;"
' Populate the Recordset.
rst.MoveLast
With rst
Do While Not .EOF
Debug.Print "Contents of recordset #" & intCount
Debug.Print , .Fields(0), .Fields(1), .Fields(2)
.MoveNext
intCount = intCount + 1
Loop
End With
dbs.Close
End Sub
I dont have any errors but for some reason the debug.print statements are not working. Is it possible that this is shut off somewhere.
Any help would be appreciated.