Part 1, Delphi
The function IDSC (a, b: integer) : integer; Stdcall;
The begin
Try
CoInitialize (nil);
DM1:=DM1. Create (application);
Dm1. ADOConnection1. The ConnectionString:='Provider=SQLOLEDB. 1; Password=sa; Persist Security Info=True; User ID=sa; Initial Catalog=test; Data Source=. Use Procedure for Prepare=1; Auto Translate=True; ';
Dm1. ADOConnection1. Connected:=TRUE;
Dm1. ADOQ. SQL. Text:="insert into test (a, b) values (' + inttostr (a) + ', '+ inttostr (b) +') './/a, b, as an integer type
Dm1. ADOQ. ExecSQL;
Result:=1;
Except,
Result:=0;
end;
Freeandnil (DM1);
end;
Exports
IDSC name 'ids';
Part 2, the Sql Server query analyzer.
The exec sp_addextendedproc 'IDSAC', 'c: \ test \ IDSAC DLL'
The EXEC IDSC 1, 2
The following error:
Server: 2812, level 16, 62, line 1
Unable to find a stored procedure 'IDSC,
CodePudding user response:
The DLL as a database stored procedure and asked for the DLL interface to a certain extent, format ofNot any DLL can be