Page 1 of 1

[Delphi] Simple example to connect to FB server?

Posted: 19.05.2009, 00:56
by littlebigman
Hello

I'm not a Delphi expert, and am having a bit of difficulty going through even the simplest of the samples "examples\simple\ZSimpleMain.pas", as it uses things like ZSQLMonitor and ZSequence that I haven't seen before, uses uses Properties instead of accessing data directly, etc.

By any chance, would someone have a working example with just a Connection, Query/UpdateSQL, and a DBGrid so that I could see how they work with Firebird?

Thank you.

Posted: 19.05.2009, 11:53
by littlebigman
I just got a little further, but I'm getting two errors (Firebird 2.1.2, ZeosLib 6.6.4):

1. The Firebird installer provides FBCLIENT.DLL, but ZeosLib expects either FBCLIENT20.DLL or FBCLIENTD.DLL.

I copied FBCLIENT.DLL as FBCLIENTD.DLL, and ZeosLib seemed happy, but...

2. ... when I reran the program: "Project Project1.exe raised exception class EZSQLException with message 'SQL Error: I/O error for file "C:\test.firebird" Error while trying to open file The system cannot find the file specified."

=> How do I connect to a Firebird server and create a brand new database + tables?

Here's my very basic source file with ZConnection:

http://pastebin.ca/1427321

The next step is obviously adding a DBGrid to connect to a DataSource, which will itself connect to a ZQuery and ZUpdateSQL for updates.

Thank you for any hint.

Posted: 19.05.2009, 12:24
by seawolf
Take a loook here

Posted: 19.05.2009, 12:44
by littlebigman
Thanks :)