各位大哥,delphi 调用Dll出现“access ... in model "D9999.dll'问题
一、主文件:unit P000002;
interface
uses
ShareMem,SysUtils,....
.....
function ljzc(fwq,yh,mm,sjk:pchar;ljfs,mmjmf:integer):pchar;
external 'D9999.dll';
......
wlsjk1:=string(ljzfc(pchar(edit2.text),pchar(edit3.text),pchar(edit4.text),pchar(edit1.text),1,0));//这句出错;
二、Dll文件
library D9999;
uses
ShareMem,.....
.......
{$R *.res}
function ljzc(fwq,yh,mm,sjk:pchar;ljfs,mmjmf:integer):pchar;stdcall; //ljfs:0,windows;1,sql;mmjm:0,不加密;1,加密
var
i:integer;
ljzf,fwqs,yhs,mms,sjks:string;
begin
fwqs:=string(fwq);
yhs:=string(yh);
sjks:=string(sjk);
if mmjmf=1 then begin
i:=mmjm(mm);
mms:=inttostr(i);
end;
if ljfs=0 then
ljzf:='Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog='
+trim(sjks)+';Data Source='+trim(fwqs)
else
if trim(mms)='' then
ljzf:='Provider=SQLOLEDB.1;Persist Security Info=False;User ID='+trim(yhs)+';Initial Catalog='
+trim(sjks)+';Data Source='+trim(fwqs)
else
ljzf:='Provider=SQLOLEDB.1;Password='+trim(mms)
+';Persist Security Info=False;User ID=sa1;Initial Catalog='
+trim(sjks)+';Data Source='+trim(fwqs);
result:=pchar(ljzf);
end;
exports
ljzc;
begin
end.
两天了,整整两天了,肿么个回事呢?