#1 2014-12-26 12:29:20

ditproz
Member
Registered: 2014-12-22
Posts: 3

Connecting to MySQL through Mormot

Ave Maria!

New to mORMot and would like to get involved...

I have looked at:

http://synopse.info/forum/viewtopic.php?id=1547

and this thread, but am struggling to get MySQL connected through FireDAC using the code above or ZEOS...

The error I get for FireDac is:

TSQLDBFireDACConnectionProperties.Create: unknown provider - available: OraMSSQLMSAccMySQLSQLiteIBPGDB2

 
SynDBFireDAC
...
Props := TSQLDBFireDACConnectionProperties.Create('192.168.1.11','dbdoor','world','open');

and for the ZEOS method I can't even compile due to missing inc file:

File not found: 'Zeos.inc'


//  {$ifdef USEZEOS}
  SynDBZeos,
//  {$endif}
...
Props := TSQLDBZEOSConnectionProperties.Create('zdbc:mysql://192.168.2.60:3306/world?username=root;password=dev', 'world', '', '');

Ideally I want to avoid ODBC...  but probably will try this as a stop gap...

Any quick points would be greatly appreciated...  Also what if my tables PkID are all GUIDs?

Environment
Windows 7
Delphi XE7 Trial

Offline

#2 2014-12-27 11:25:35

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,655
Website

Re: Connecting to MySQL through Mormot

For SynDBFireDac, the URI should be set as documented, e.g.

  Props :=  TSQLDBFireDACConnectionProperties.Create('MySQL?Server=localhost;Port=3306',
      'test','root');

And for Zeos, the easiest is to use TSQLDBZEOSConnectionProperties.URI, as such

Props := TSQLDBZEOSConnectionProperties,TSQLDBZEOSConnectionProperties.URI(
      dMySQL,'localhost:3306'),'test','root');

The documentation is pretty straighforward about this.
See for instance http://synopse.info/files/html/Synopse% … #TITLE_162 or the sample 15.

Offline

#3 2014-12-30 14:55:56

ditproz
Member
Registered: 2014-12-22
Posts: 3

Re: Connecting to MySQL through Mormot

Ave Maria!

Thanks for getting back to me so quickly...

Still with the connection of the ZEOS - the error - File not found: 'Zeos.inc' ...

Does this inc file come with the mORMot library / framework files?

I hope you enjoyed Christmas...

God Bless

Dan

Environment
Windows 7
Delphi XE7 Trial

Offline

#4 2014-12-30 16:21:01

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,655
Website

Re: Connecting to MySQL through Mormot

The Zeos.inc is part of Zeos itself.
Ensure you added the root "src" folder to your "include" path in the IDE.

Offline

Board footer

Powered by FluxBB