Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Interbase/Firebird API call

Status
Not open for further replies.

badukist

Programmer
Jun 26, 2003
146
RO
Anyone know how to call this API function in Foxpro?
I need to call this to be able to create a Firebird database "on the fly" (ODBC/OLE DB doesn't support CREATE DATABASE command)

Code:
ISC_STATUS isc_dsql_execute_immediate(
ISC_STATUS *status_vector,
isc_db_handle *db_handle,
isc_tr_handle *trans_handle,
unsigned short length,
char *statement,
unsigned short dialect,
XSQLDA *xsqlda);
[code]

ISC_STATUS is long type
isc_db_handle, isc_tr_handle are void type

A have a C call that works, but I don't know how to translate it into a VFP call.
[code]
ISC_STATUS status_vector[20];
char *statement =
"CREATE DATABASE ’C:/INVENTORY.GDB’ PAGE_SIZE 4096 USER ’SYSDBA’ PASSWORD ’masterkey’";
isc_db_handle db_handle = NULL;
isc_tr_handle dummy_handle = NULL;
isc_dsql_execute_immediate(
status_vector,
&db_handle,
&dummy_handle,
0,
statement,
1,
NULL);
if (status_vector[0] == 1 && status_vector[1])
{
/* Process error. */
isc_print_status(status_vector);
return(1);
}

Thanks in advance.

 
I don't know anything about this API call, but one trick I have used in the past when I need to create a database or table in prodct is to use the native product to create a blank one, and then make a copy of that shell to the name you need. Then you can move forward.

This may get you by the current delima and allow you to move forward.

Kind of quick and dirty, but sometimes thats okay too.

Jim Osieczonek
Delta Business Group, LLC
 
Already done this, but the empty database is quite big, Firebird is an advanced server with a lot of system tables in every database. I can reduce the size by compressing it, but it would be nice if I would succed to create the new database by code.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top