You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Release Notes FB 2.* -> Changes to the Firebird API and ODS -> API (Application Programming Interface) -> 'Accommodation of New Shutdown <state> Parameters' -> Example of Use in C/C++
I wasn't familiar with ClumpetWriter, but I am now :( I just wanted to improve delphi component using this example .. 2 hours of 'WTF?!'s till I explored FB source code.
The text was updated successfully, but these errors were encountered:
why:
after command (isc_dpb_shutdown) if it has argument (isc_dpb_shut_force | isc_dpb_shut_full) a length of this argument (1 byte) must be placed in buffer before argument.
Submitted by: Konstantin Dombrugov (abracadabra)
Release Notes FB 2.* -> Changes to the Firebird API and ODS -> API (Application Programming Interface) -> 'Accommodation of New Shutdown <state> Parameters' -> Example of Use in C/C++
char dpb_buffer[256], *dpb, *p;
ISC_STATUS status_vector[ISC_STATUS_LENGTH];
isc_db_handle handle = NULL;
dpb = dpb_buffer;
*dpb++ = isc_dpb_version1;
const char* user_name = "SYSDBA";
const int user_name_length = strlen(user_name);
*dpb++ = isc_dpb_user_name;
*dpb++ = user_name_length;
memcpy(dpb, user_name, user_name_length);
dpb += user_name_length;
const char* user_password = "masterkey";
const int user_password_length = strlen(user_password);
*dpb++ = isc_dpb_password;
*dpb++ = user_password_length;
memcpy(dpb, user_password, user_password_length);
dpb += user_password_length;
// Force an immediate full database shutdown
*dpb++ = isc_dpb_shutdown;
//THERE IT IS!! it's a length of the following value__________________________________________________
*dpb++ = 1;
//
*dpb++ = isc_dpb_shut_force | isc_dpb_shut_full;
const int dpb_length = dpb - dpb_buffer;
isc_attach_database(status_vector,
0, "employee.db",
&handle,
dpb_length, dpb_buffer);
if (status_vector[0] == 1 && status_vector[1])
{
isc_print_status(status_vector);
}
else
{
isc_detach_database(status_vector, &handle);
}
I wasn't familiar with ClumpetWriter, but I am now :( I just wanted to improve delphi component using this example .. 2 hours of 'WTF?!'s till I explored FB source code.
The text was updated successfully, but these errors were encountered: