J
Joe Williams
I am getting an error when I try to call a stored procedure from Access. The
error is as follows: "[Microsoft][OBDC SQL Driver][SQL Server] Invalid
length parameter passed to the substring function."
It has been working fine for months until yesterday, with no code changes
being done. I thought maybe teh data is the problem, but if I run the stored
procedure from the SQL Query Analyzer on the server, I receive no error
message. It seems to be something between Access and SQL.
What could be up? Below is the code that lies behind a form button that
calls the stored procedure. Help!
Dim objConn As ADODB.Connection
Dim objCmd As New ADODB.Command
' Open a connection without using a Data Source Name (DSN)
Set objConn = New ADODB.Connection
objConn.ConnectionString = "Driver=SQL Server;Server=TRADB1;" & _
"Database=AllData;UID=user;PWD=password;"
objConn.open
Set objCmd.ActiveConnection = objConn
objCmd.CommandText = "WorkOrderTransferImport"
objCmd.CommandType = adCmdStoredProc
objCmd.Parameters.Refresh
objCmd.Execute
' clean up
objConn.Close
Set objConn = Nothing
Thanks,
Joe
error is as follows: "[Microsoft][OBDC SQL Driver][SQL Server] Invalid
length parameter passed to the substring function."
It has been working fine for months until yesterday, with no code changes
being done. I thought maybe teh data is the problem, but if I run the stored
procedure from the SQL Query Analyzer on the server, I receive no error
message. It seems to be something between Access and SQL.
What could be up? Below is the code that lies behind a form button that
calls the stored procedure. Help!
Dim objConn As ADODB.Connection
Dim objCmd As New ADODB.Command
' Open a connection without using a Data Source Name (DSN)
Set objConn = New ADODB.Connection
objConn.ConnectionString = "Driver=SQL Server;Server=TRADB1;" & _
"Database=AllData;UID=user;PWD=password;"
objConn.open
Set objCmd.ActiveConnection = objConn
objCmd.CommandText = "WorkOrderTransferImport"
objCmd.CommandType = adCmdStoredProc
objCmd.Parameters.Refresh
objCmd.Execute
' clean up
objConn.Close
Set objConn = Nothing
Thanks,
Joe