Subject Connecting to db using C
Author William L. Thomson Jr.
On Sun, 2002-06-23 at 23:32, Paul Reeves wrote:
> William L. Thomson Jr. wrote:
> > I was looking at the InterBase examples that come with IB 6.0, but they
> > all seem to use isc_attach. Which I assume is for db residing on the
> > same machine. Where my db will be on a remote machine.
>
> isc_attach() is the only way to attach to a database. The client library
> will parse the database name and call the relevant server. You need this
> format:
>
> servername:/path/to/my/database.gdb

I am attempting to use a modified version of api3.c, that is in the
examples dir. By modified I mean I have changed the sql query slightly
and am pointing it at one of my db's on a remote server. By remote I
mean on the lan but not on the same machine.

I can compile the c app fine, but when I attempt to run it says

Unable to complete network request to host "localhost".
-Failed to establish a connection.
-Connection refused
invalid database handle (no active connection)

Where is the localhost coming from. Is there some var that I am not
setting but need to?

Sorry for not having looked in the docs for an answer, but based on the
comment above, by using a servername:/path/to/db.gdb should be able to
use isc_attach();

Although it appears to be trying to connect to the localhost. No good.

--
Sincerely,
William L. Thomson Jr.
Support Group
Obsidian-Studios Inc.
439 Amber Way
Petaluma, Ca. 94952
Phone 707.766.9509
Fax 707.766.8989
http://www.obsidian-studios.com