sqldirect connection avec oracle
salut tout le monde,
j´ai un petit probleme avec sqldirect(SDengine),
je n´arrive pas a me connecter sur une base de données oracle.
voici mon code :
Code:
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
|
SDDatabase1.ServerType := stOracle;
SDDatabase1.DatabaseName := 'dbtest';
SDDatabase1.Params.Clear;
SDDatabase1.RemoteDatabase := 'localhost';
SDDatabase1.Params.Add('USER NAME=' + Username);
SDDatabase1.Params.Add('PASSWORD=' + Password);
SDDatabase1.Params.Add('CACHED UPDATES=False');
SDDatabase1.Params.Add('AUTOCOMMIT=True');
SDDatabase1.LoginPrompt := (Username = '') or (Password = '');
SDDatabase1.TransIsolation := SDEngine.tiReadCommitted; //tiDirtyRead;
SDQuery1 := TSDQuery.Create(nil);
SDQuery1.Close;
SDQuery1.BeforeOpen := nil;
SDQuery1.DatabaseName := SDDatabase1.DatabaseName;
SDQuery1.SessionName := SDDatabase1.Session.SessionName;
SDQuery1.Database := SDDatabase1;
SDQuery1.SQL.Clear;
SDQuery1.SQL.Add('Select * From test ');
try
SDQuery1.Open;
i := 0;
while not SDQuery1.EOF do
begin
AList[i] := SDQuery1.FieldByName('NOM').AsString;
Inc(i);
end;
SDQuery1.Close;
except on E:Exception do
ShowMessage(E.Message);
End; |
quelqu´un a-t- il une idée?
Merci d´avance