SQL Serv Syntax Error or Access Violation

  • Thread starter Thread starter Mike Thomas
  • Start date Start date
M

Mike Thomas

This one must be very simple. I am trying to run an SCL Serv 70 stored proc
from a VBA module in an Access 2000 app. This stored proc runs fine when I
remove the parameters from the stored proc and from the COmmandText string
below, but when I run it as is I get the error above on the "Execute" line.
The connection string seems ok, it works everywhere else.

glConnCmd.CommandText = "_ContactFetchLike 'Thom%'"
glConnCmd.CommandType = adCmdStoredProc
glConnCmd.Execute
rs.Open glConnCmd

This is the stored proc:

CREATE procedure _ContactFetchLike
@strString varchar(30)
AS SELECT * FROM contact WHERE company like @strString

RETURN

It must be something pretty simple. Does any have any ideas.

Many thanks
MIke Thomas
 
Are you using .ADP or .MDB
if you are using .ADP, you may need to use an input
parameter command

May
MCP in Access and SQL Server
 
Back
Top