M
MSNews
Dear All
I am using Access 2000 with SQL 2000 and i am trying to run a stored
procedure from Access and i am not using a data project.
When i run this code i get an error :
Method Execute of object _command failed
Here is my code:
Dim cn As ADODB.Connection
Dim cmd As ADODB.Command
Dim rs As ADODB.Recordset
' Create connection and command objects
Set cn = New ADODB.Connection
Set cmd = New ADODB.Command
Set rs = New ADODB.Recordset
' Set connection properties and open
cn.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;User
ID=sa;Initial Catalog=Rugby; " & _
"Data Source=PROZONEDB"
cn.CursorLocation = adUseClient
cn.Open
' Set command properties
With cmd
Set .ActiveConnection = cn
.CommandText = "sp_Append_Fitness"
.CommandType = adCmdStoredProc
End With
' Execute the command
Set rs = cmd.Execute
Many Thanks
Ash
I am using Access 2000 with SQL 2000 and i am trying to run a stored
procedure from Access and i am not using a data project.
When i run this code i get an error :
Method Execute of object _command failed
Here is my code:
Dim cn As ADODB.Connection
Dim cmd As ADODB.Command
Dim rs As ADODB.Recordset
' Create connection and command objects
Set cn = New ADODB.Connection
Set cmd = New ADODB.Command
Set rs = New ADODB.Recordset
' Set connection properties and open
cn.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;User
ID=sa;Initial Catalog=Rugby; " & _
"Data Source=PROZONEDB"
cn.CursorLocation = adUseClient
cn.Open
' Set command properties
With cmd
Set .ActiveConnection = cn
.CommandText = "sp_Append_Fitness"
.CommandType = adCmdStoredProc
End With
' Execute the command
Set rs = cmd.Execute
Many Thanks
Ash