I'm using SQL2005, and SDAC 3.70.1.25. I get an error when I attempt to assign a parameter to a Stored Procedure call using SDAC. I have verified that the parameter exists and can issue T-SQL using the same stored procedure and it works fine. Here is the stored procedure (partial):
CREATE PROCEDURE usp_UpdateADComputerTable
--Agruments
@DCName VARCHAR(128) -- Domain Controller
AS
.......
Delphi code;
procedure UpdateADComputerTable(Conn: TMSConnection; DCName: String);
const
cUpdateADComputerTable = 'usp_UpdateADComputerTable;1';
var
SP: TMSStoredProc;
begin
if (Conn = nil) then Exit;
SP := TMSStoredProc.Create(nil);
SP.Connection := Conn;
SP.StoredProcName := cUpdateADComputerTable;
SP.Params.ParamValues['DCName'] := DCName;
SP.FetchAll := TRUE;
try
RunStoredProc(SP);
SP.Free;
except on E: Exception do
begin
SP.Free;
raise Exception.CreateFmt(cDataIOException,[E.Message]);
end;
end; // try
This code fails on the line:
SP.Params.ParamValues['DCName'] := DCName;
with the exception:
'Parameter 'DCName' not found'
Any ideas on what might cause this? and how to fix it?
Thanks
Ken
Stored Prodecure parameter does not exist error
-
- Posts: 12
- Joined: Fri 20 Jan 2006 17:44