4 replies
by miss kitty
The problem is probably how you're trying to access the database. Below is a sample code of how to connect to a table within an Access database and run an Access query.
Dim objConn As New ADODB.Connection
Dim objCmd As New ADODB.Command
Dim objRS As New ADODB.Recordset
Dim objParam As ADODB.Parameter
Dim count As Integer
'set up the database pointer
objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=E:\ACCESS\CONTRACT HAULERS\HAULER.mdb;User ID=ADMIN"
objRS.CursorType = adOpenDynamic
objRS.LockType = adLockOptimistic
'setting the Active Connection for the command object
objCmd.ActiveConnection = objConn
'Providing the query name as commandtext
objCmd.CommandText = "[DELETE TTICKET QUERY]"
objCmd.CommandType = adCmdStoredProc
'Set the recordset to the command object result
Set objRS = objCmd.Execute
Good Luck
Cathy
by cyberbob
by bordsoft
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending