Question

I have a WindowsXPSP3 op system, on it a DelphiXE and InterbaseXE installed. I created a database in IB and it works OK through the IBConsole and ISQL and connection testing also works through TCP/IP localhost:3050. Now I try to access it from Delphi.

I did:

var AC:tADOConnection;
...
AC:=tADOConnection(Self);
AC.ConnectionString:=
AC.Open;

I tried all possible version I could google for the ConnectionString, but all generated an error. I used various Provider= versions, etc., but none works. Could someone provide me with a simple working ConnectionString? Do I need to install any ADO driver or similar additionally? Thanks, Zsolt

Was it helpful?

Solution

There are two ways to easily create a valid connection string

a.1) Click on the small button in the object inspector right of the connection string property.
a.2) Create your connection, test it, press OK

or

b.1) Create an empty file e.g. 'TEST.UDL'. Use Notepad.EXE for example.
b.2) Double click on the file in the explorer. This will open the connection string editor
b.3) Create your connection, test it. Press OK
b.4) Your file now contains the connection string which you may copy&past in your application

Another benefit of the second method is that you can even use the file as a connection string. This makes life alot easier if you have to configure your connection from time to time (Just double click on the UDL if you have to change the connection properties). Here's how a valid connection string for a file looks like:

FILE NAME=<Full path to your UDL file>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top