Search code examples
delphidelphi-7interbase

Connecting to local server via dBExpress


My D7 dBExpress project is supposed to connect to a local Interbase XE7 server. It has the usual DBX setup: SqlConnection, SqlQuery, DataSetProvider and ClientDataSet and does a simple 'select * from mytable'.

Last time I used it, it was working fine, but today when I ran it inside the IDE, I get an exception as I call

ClientDataSet1.Open;

in my FormCreate (that call is the entire code of the project, btw). The exception is an EDatabaseError with msg "No mapping for Error Code Found." and happens in TSqlConnection.DoConnect


Solution

  • That sounds familiar - I got that error myself one time, when I went back to an IB project after a few weeks.

    It turned out that in the meantime something had sneaked Firebird onto my machine and it had hijacked the port IB usually listens on, and it was actually this FB server which was rejecting the connection, not the Interbase one!

    Take a look under Services to see whether there is an FB server running. If there are, close it down (and start the IB server if not already running, of course). Then try your DBX project again.

    Somewhere in the IB docs, I found something which seemed to suggest there was a way of getting FB and IB servers to coexist, but to avoid falling into a similar trap another time, I wrote a couple of batch files to shut down one of them and start the other. One is called "UseIB" and contains:

    net stop "Firebird server - DefaultInstance"
    net start "InterBase XE7 Server gds_db"
    

    The other one, "UseFB" just does the opposite, of course.