Hi all.
I am afraid I have what is probably a very stupid problem.
I have never used the command object before but now find that I have to as I have atrted using ADO and cannot get SQL to pass any parameters back to access when I run my stored procedure.
If someone could please have a look at this code and tell me where I am going wrong I would be most grateful.
This code is just to run the stored procedure. I have not even got as far as passing the parameter back.
Dim connODBC As Connection
Dim rst As New ADODB.Recordset
Dim cmd As ADODB.Command
Set cmd = New ADODB.Command
connODBC.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=DATABASE;Data Source=SERVER"
With cmd
.CommandText = "sp_tblNameLoc_SEL"
.Parameters.Refresh
.CommandType = adCmdStoredProc
End With
Set rst = cmd.Execute
Am I doing something idiotic or is it the connection.
I can call and execute spored procedures using this connection but maybe it needs to amended to use the COMMAND object.
Please help....
I am afraid I have what is probably a very stupid problem.
I have never used the command object before but now find that I have to as I have atrted using ADO and cannot get SQL to pass any parameters back to access when I run my stored procedure.
If someone could please have a look at this code and tell me where I am going wrong I would be most grateful.
This code is just to run the stored procedure. I have not even got as far as passing the parameter back.
Dim connODBC As Connection
Dim rst As New ADODB.Recordset
Dim cmd As ADODB.Command
Set cmd = New ADODB.Command
connODBC.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=DATABASE;Data Source=SERVER"
With cmd
.CommandText = "sp_tblNameLoc_SEL"
.Parameters.Refresh
.CommandType = adCmdStoredProc
End With
Set rst = cmd.Execute
Am I doing something idiotic or is it the connection.
I can call and execute spored procedures using this connection but maybe it needs to amended to use the COMMAND object.
Please help....