Hi. I still problems with MS-Access and SQl server 7.0. I want execute a stored procedure from Access. I declare the variables in Access, and I want to use these variables as input parameters to Stored Procedure. This is the code:
Dim param1 As ADODB.Parameter
Dim param2 As ADODB.Parameter
Dim ObjCommand As ADODB.Command
Dim Rs As ADODB.Recordset
Set ObjCommand = server.CreateObject
ObjCommand.ActiveConnection = dbconnection
ObjCommand.CommandText = "SPActCtaTerPer"
ObjCommand.CommandType = adCmdStoredProc
'assign the parameters (must be in correct order for SQL stored procedure or the order they are encountered in in the Access where clause
'PARAMETER 1
Set param1 = ObjCommand.CreateParameter("@Ids", adInteger, adParamInput)
ObjCommand.Parameters.Append param1
ObjCommand.Parameters("Ids"
= Texto1
Set param2 = ObjCommand.CreateParameter("@Bln", adBoolean, adParamInput)
ObjCommand.Parameters.Append param2
ObjCommand.Parameters("Bln"
= Texto3
' Execute the sql
Set Rs = ObjCommand.Execute
'release memory re command object
Set param1 = Nothing
Set param2 = Nothing
Set ObjCommand = Nothing
This is not RUN !!! Help me please!!! Thanks
Mauricio
Dim param1 As ADODB.Parameter
Dim param2 As ADODB.Parameter
Dim ObjCommand As ADODB.Command
Dim Rs As ADODB.Recordset
Set ObjCommand = server.CreateObject
ObjCommand.ActiveConnection = dbconnection
ObjCommand.CommandText = "SPActCtaTerPer"
ObjCommand.CommandType = adCmdStoredProc
'assign the parameters (must be in correct order for SQL stored procedure or the order they are encountered in in the Access where clause
'PARAMETER 1
Set param1 = ObjCommand.CreateParameter("@Ids", adInteger, adParamInput)
ObjCommand.Parameters.Append param1
ObjCommand.Parameters("Ids"
Set param2 = ObjCommand.CreateParameter("@Bln", adBoolean, adParamInput)
ObjCommand.Parameters.Append param2
ObjCommand.Parameters("Bln"
' Execute the sql
Set Rs = ObjCommand.Execute
'release memory re command object
Set param1 = Nothing
Set param2 = Nothing
Set ObjCommand = Nothing
This is not RUN !!! Help me please!!! Thanks
Mauricio