1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| procedure TFormMain.Button1Click(Sender: TObject);
var AString : String;
begin
if FormStdSAP.SAPLogonDone = False then begin
FormStdSAP.SAPGuiApplication := TGuiApplication.Create(Self);
FormStdSAP.SAPScriptingLogon(ApplicationPath,AString);
end else begin
FormStdSAP.SAPGuiApplication.Free;
FormStdSAP.SAPLogonDone := false;
end;
end;
procedure TFormMain.Button2Click(Sender: TObject);
begin
if ASQLConnection = nil then begin
try
ASQLConnection := TSQLConnection.Create(Self);
ASQLConnection.ConnectionName := 'OracleConnection';
ASQLConnection.DriverName := 'Oracle';
ASQLConnection.GetDriverFunc := 'getSQLDriverORACLE';
ASQLConnection.LibraryName := 'dbexpora.dll';
ASQLConnection.LoginPrompt := false;
ASQLConnection.VendorLib := 'oci.dll';
ASQLConnection.Name := 'SQLConnection1';
ASQLConnection.TableScope := [tsTable,tsView];
ASQLConnection.LoadParamsOnConnect := false;
ASQLConnection.Params.Loadfromfile('c:\Tests\Inifiles\dbxconnections.ini');
ASQLConnection.Connected := True;
except
end;
end else begin
ASQLConnection.Connected := False;
ASQLConnection.Free;
ASQLConnection := nil;
end;
end; |
Partager