Einzelnen Beitrag anzeigen

TUX_der_Pinguin

Registriert seit: 1. Jun 2005
Ort: Anholt (NRW)
608 Beiträge
 
Delphi 11 Alexandria
 
#10

Re: Problem mit dem Zugriff auf die Datenbank

  Alt 19. Jan 2007, 13:05
Ich habe das ganze noch mal wie folgt ausprobiert es ändert sich aber nichts, die Verbindung klappt die Abfrage nicht.

Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
  SQLConnection : TSQLConnection;
  SQLQuery : TSQLQuery;

begin
  SQLConnection := TSQLConnection.Create(Self);
  SQLConnection.ConnectionName := 'SQLCon';
  SQLConnection.DriverName := 'MYSQL';
  SQLConnection.GetDriverFunc := 'getSQLDriverMYSQL';
  SQLConnection.LibraryName := 'dbxmys30.dll';
  SQLConnection.VendorLib := 'LIBMYSQL.dll';

  SQLConnection.Params.Values['BlobSize'] := '-1';
  SQLConnection.Params.Values['Database'] := 'Kunden';
  SQLConnection.Params.Values['ErrorRessourceFile'] := '';
  SQLConnection.Params.Values['HostName'] := 'localhost';
  SQLConnection.Params.Values['LocaleCode'] := '0000';
  SQLConnection.Params.Values['User_Name'] := 'root';
  SQLConnection.Params.Values['Password'] := 'pwd';
  SQLConnection.Params.Values['Compressed'] := 'False';
  SQLConnection.Params.Values['Encrypted'] := 'False';

  SQLConnection.LoginPrompt := False;
  SQLConnection.ParamsLoaded := True;
  SQLConnection.KeepConnection := True;
  SQLConnection.Connected := True;

  SQLConnection.Open;
  Memo1.Lines.Add('Verbindung hergestellt ...!');


  SQLQuery := TSQLQuery.Create(Self);
  SQLQuery.SQLConnection := SQLConnection;
  SQLQuery.SQL.Text := 'Select * from Kunde';
  SQLQuery.Active := True;



  SQLConnection.Close;
  SQLConnection.Free;
  Memo1.Lines.Add('Verbindung beendet ...!');

end;
  Mit Zitat antworten Zitat