below code:
procedure TForm1.Button1Click(Sender: TObject);
var
CRDEngine : HWnd;
PELogOnServer : TFarProc;
LogInfo : PELogOnInfo;
pDllName : array[0..255] of Char;
sServerName,
sDatabaseName,
sUserId,
sPassword,
sDllName : string;
result :bool;
begin
//Result:= False;
CRDEngine := LoadLibrary('f:\temp\crpe32.dll');
{If an error occured, set the flag}
if (CRDEngine < HINSTANCE_ERROR) then
begin
ShowMessage('load dll error');
abort;
end ;
PELogOnServer := GetProcAddress(CRDEngine, 'PELogOnServer');
if PELogOnServer = nil then
begin
ShowMessage('load function error');
abort;
end ; LogInfo.StructSize := SizeOf(PELogOnInfo);
sServerName := 'blmdev.world';
sDatabaseName := ''; {not usually req'd for Oracle}
sUserId := 'loan_admin';
sPassword := 'lipsadmin';
sDllName := 'crdb_odbc.dll';
{Populate the PELogOnInfo structure}
StrPCopy(@LogInfo.ServerName, sServerName);
StrPCopy(@LogInfo.DatabaseName, sDatabaseName);
StrPCopy(@LogInfo.UserID, sUserId);
StrPCopy(@LogInfo.Password, sPassword);
StrPCopy(pDllName, sDllName);
Result := TPELogOnServer(PELogOnServer)(pdllName, logInfo);
IF Result=false then
//if PELogOnServer('PDSODBC.DLL',LogInfo)= False then
ShowMessage('not connect oracle server ');
end;end.
procedure TForm1.Button1Click(Sender: TObject);
var
CRDEngine : HWnd;
PELogOnServer : TFarProc;
LogInfo : PELogOnInfo;
pDllName : array[0..255] of Char;
sServerName,
sDatabaseName,
sUserId,
sPassword,
sDllName : string;
result :bool;
begin
//Result:= False;
CRDEngine := LoadLibrary('f:\temp\crpe32.dll');
{If an error occured, set the flag}
if (CRDEngine < HINSTANCE_ERROR) then
begin
ShowMessage('load dll error');
abort;
end ;
PELogOnServer := GetProcAddress(CRDEngine, 'PELogOnServer');
if PELogOnServer = nil then
begin
ShowMessage('load function error');
abort;
end ; LogInfo.StructSize := SizeOf(PELogOnInfo);
sServerName := 'blmdev.world';
sDatabaseName := ''; {not usually req'd for Oracle}
sUserId := 'loan_admin';
sPassword := 'lipsadmin';
sDllName := 'crdb_odbc.dll';
{Populate the PELogOnInfo structure}
StrPCopy(@LogInfo.ServerName, sServerName);
StrPCopy(@LogInfo.DatabaseName, sDatabaseName);
StrPCopy(@LogInfo.UserID, sUserId);
StrPCopy(@LogInfo.Password, sPassword);
StrPCopy(pDllName, sDllName);
Result := TPELogOnServer(PELogOnServer)(pdllName, logInfo);
IF Result=false then
//if PELogOnServer('PDSODBC.DLL',LogInfo)= False then
ShowMessage('not connect oracle server ');
end;end.
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货