Subject Re: [firebird-support] Re: isc_interprete/fb_interprete...A Stupid Question...
Author Kurt Federspiel
Perfect...Thanks a lot.


----- Original Message ----
From: Iman S. H. Suyoto <ade@...>
Sent: Thursday, June 26, 2008 5:02:38 PM
Subject: [firebird-support] Re: isc_interprete/fb_interprete...A Stupid Question...

--- In firebird-support@ yahoogroups. com, "federonline"
<federonline@ ...> wrote:
> I'm debugging with valgrind and got a warning that isc_interprete is
> depricated. In looking through the header file, I see that
> fb_interprete is there with an added argument. Is the difference
> documented in the FB Book or somewhere else?

The second parameter specifies the length of the buffer supplied in
the first parameter:

http://tech. com/group/ firebird- support/message/ 81285

> Also, is there a better way to set USER/PASS than isc_expand_dpb
> (since it is also depricated)?

Here's an example in C (sorry, I'm not really good in C++, so I don't
know whether this is idiomatic in C++. But I hope you get the idea).

char dpb_buffer[SHRT_ MAX + 1] = {0};
char *dpb = dpb_buffer;
char *username = "username";
char *password = "password";
char username_len = strlen(username) ;
char password_len = strlen(password) ;

*dpb++ = isc_dpb_version1;

/* Set number of cache buffers */
*dpb++ = isc_dpb_num_ buffers;
*dpb++ = 1;
*dpb++ = CHAR_MAX;

/* Set SQL dialect */
*dpb++ = isc_dpb_sql_ dialect;
*dpb++ = 1;

/* Set username */
*dpb++ = isc_dpb_user_ name;
*dpb++ = username_len;
strcpy(dpb, username);
dpb += username_len;

/* Set password */
*dpb++ = isc_dpb_password;
*dpb++ = password_len;
strcpy(dpb, password);
dpb += password_len;


[Non-text portions of this message have been removed]