Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Datenbanken (https://www.delphipraxis.net/15-datenbanken/)
-   -   Delphi MYSQL Webserver connecten. (https://www.delphipraxis.net/112876-mysql-webserver-connecten.html)

youu 28. Apr 2008 19:09

Datenbank: MYSQL • Version: 5. • Zugriff über: ...

MYSQL Webserver connecten.
 
Hallo erstmal,

Ich möchte gerne auf eine MYSQL Datenbank connecten die auf einem Webserver ist. (Mein eiegenen)
Nur weiß ich ehrlich gesagt noch überhaupt nicht wie.

Ich habe diesen Code per Suche gefunden, wenn ich dies allerdings teste sagt er mir immer:

Cannot load LIBMYSQL.DLL liabary (error code 126).


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']          := 'password';
  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;

Ich hoffe jemand kann mir da weiterhelfen bzw ein bespiel zeigen wie man drauf connectet, ausließt und speichert.

MFG

Phoenix 28. Apr 2008 20:31

Re: MYSQL Webserver connecten.
 
Die Fehlermeldung ist eigentlich ziemlich aussagekräftig. Wo liegt denn die libmysql.dll bei Dir? Leg sie mal zur Sicherheit ins Verzeichnis Deiner Anwendung, dann sollte die auf jeden Fall gefunden und geladen werden können.


Alle Zeitangaben in WEZ +1. Es ist jetzt 20:10 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz