为什么编译程序总是出现错误提示:
Project MDIAPP.exe raised exception class EACESSVIOLATION with message'Acess violation at adress 004752c6 in module 'MDIAPP.exe'.Read of Address 0000006c'.Process stopped. Use step or run to continue.
是什么原因,怎么处理
...全文
757打赏收藏
异常处理
为什么编译程序总是出现错误提示: Project MDIAPP.exe raised exception class EACESSVIOLATION with message'Acess violation at adress 004752c6 in module 'MDIAPP.exe'.Read of Address 0000006c'.Process stopped. Use step or run to continue. 是什么原因,怎么处理
function DBSConnect(StrUseID:string;StrPasswd:string;strCatalog:string;
strMachineName:string;var mcntConnect:Tadoconnection;var strError:string):Integer;
var strConnect:string;
begin
try
if ([stConnecting] = mcntConnect.State) then \\\\\\\\出错就在这行
mcntConnect.Close ;
strConnect:= 'Provider=SQLOLEDB.1;Persist Security Info=True;User ID=' +
Trim(strUseID) +';Password=' + Trim(strPasswd) +
';Initial Catalog=' + Trim(strCatalog) +
';Data Source=' + strMachinename;
mcntConnect.ConnectionTimeout:=20;
mcntConnect.CommandTimeout:=1000;
mcntConnect.Open(strConnect,'');
Result:=0;
except
on E:Exception do
begin
strError:=E.Message ;
Result:=1;
end;
end;