Subject | RE: [firebird-support] C API - isc_attach |
---|---|
Author | Dan Crea |
Post date | 2003-06-27T14:43:11Z |
Hello:
From you code example, it looks like you may need to specify a full path to
the database file. Not specifying a path will use the working directory.
So running this binary elsewhere will not find the file. (I'm not 100% sure
on the working directory point...)
Example:
isc_attach_database(status, 0, "localhost/usr/local/firebird/kerio.fdb",
&db, 0, 0);
or
isc_attach_database(status, 0, "/usr/local/firebird/kerio.fdb", &db, 0, 0);
However, if the db file is not found you should get an error in the
ISC_STATUS vector. You should copy this vector and pass the copy to
isc_interprete(...) to see what the error is. Assuming (vector[0] == 1 &&
vector[1] > 0) is true.
Regards,
Dan
-----Original Message-----
From: Roman Jokl [mailto:rjokl@...]
Sent: Friday, June 27, 2003 3:10 AM
To: firebird-support@yahoogroups.com
Subject: [firebird-support] C API - isc_attach
Hello,
I have problem with isc_attach_database() function in C API, Debian
linux, FB version 1.5. This code:
---------
#include "ibase.h"
int main (int argc, char *argv[])
{
isc_db_handle db = NULL; /* database handle */
ISC_STATUS_ARRAY status; /* status vector */
printf("attaching db...\n");
isc_attach_database (status, 0, "kerio.fdb", &db, 0, NULL);
printf("db attached\n");
if (status[0] == 1 && status[1]) {
isc_print_status (status);
return 1;
}
...
-------
compiled as :
gcc -lfbembed -ldl -lcrypt -lstdc++ fill_t_p.c -o fill_t_p
works ok in /usr/local/firebird/examples directory. Elsewhere the
function terminate program without any error message.
Jolly
Yahoo! Groups Sponsor
ADVERTISEMENT
<http://rd.yahoo.com/M=244522.3313099.4604523.1261774/D=egroupweb/S=17051153
86:HM/A=1595055/R=0/SIG=1240u9le2/*http://ashnin.com/clk/muryutaitakenattogy
o?YH=3313099&yhad=1595055> Click Here!
<http://us.adserver.yahoo.com/l?M=244522.3313099.4604523.1261774/D=egroupmai
l/S=:HM/A=1595055/rand=631795275>
To unsubscribe from this group, send an email to:
firebird-support-unsubscribe@yahoogroups.com
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> .
[Non-text portions of this message have been removed]
From you code example, it looks like you may need to specify a full path to
the database file. Not specifying a path will use the working directory.
So running this binary elsewhere will not find the file. (I'm not 100% sure
on the working directory point...)
Example:
isc_attach_database(status, 0, "localhost/usr/local/firebird/kerio.fdb",
&db, 0, 0);
or
isc_attach_database(status, 0, "/usr/local/firebird/kerio.fdb", &db, 0, 0);
However, if the db file is not found you should get an error in the
ISC_STATUS vector. You should copy this vector and pass the copy to
isc_interprete(...) to see what the error is. Assuming (vector[0] == 1 &&
vector[1] > 0) is true.
Regards,
Dan
-----Original Message-----
From: Roman Jokl [mailto:rjokl@...]
Sent: Friday, June 27, 2003 3:10 AM
To: firebird-support@yahoogroups.com
Subject: [firebird-support] C API - isc_attach
Hello,
I have problem with isc_attach_database() function in C API, Debian
linux, FB version 1.5. This code:
---------
#include "ibase.h"
int main (int argc, char *argv[])
{
isc_db_handle db = NULL; /* database handle */
ISC_STATUS_ARRAY status; /* status vector */
printf("attaching db...\n");
isc_attach_database (status, 0, "kerio.fdb", &db, 0, NULL);
printf("db attached\n");
if (status[0] == 1 && status[1]) {
isc_print_status (status);
return 1;
}
...
-------
compiled as :
gcc -lfbembed -ldl -lcrypt -lstdc++ fill_t_p.c -o fill_t_p
works ok in /usr/local/firebird/examples directory. Elsewhere the
function terminate program without any error message.
Jolly
Yahoo! Groups Sponsor
ADVERTISEMENT
<http://rd.yahoo.com/M=244522.3313099.4604523.1261774/D=egroupweb/S=17051153
86:HM/A=1595055/R=0/SIG=1240u9le2/*http://ashnin.com/clk/muryutaitakenattogy
o?YH=3313099&yhad=1595055> Click Here!
<http://us.adserver.yahoo.com/l?M=244522.3313099.4604523.1261774/D=egroupmai
l/S=:HM/A=1595055/rand=631795275>
To unsubscribe from this group, send an email to:
firebird-support-unsubscribe@yahoogroups.com
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> .
[Non-text portions of this message have been removed]