Subject Re: [firebird-support] Re: api and grant problems
Author Olivier Mascia
Hi,

Le 21-févr.-05, à 11:29, Nicholas Cain a écrit :

> the dbp structure that came out of isc_expand_dpb was garbage. I've no
> idea why (there was a few shameful pointer mess-ups on my part, but
> even with those fixed it still didn't make any sense).
>
> in the end this worked;
>
> char dpb_buffer[256], *dpb, *p;
> short dpb_length;
> dpb = dpb_buffer;
> *dpb++ = isc_dpb_version1;
> *dpb++ = isc_dpb_num_buffers;
> *dpb++ = 1;
> *dpb++ = 90;
>
> char* username = "dbUser";
> *dpb++ = isc_dpb_user_name;
> *dpb++ = strlen(username);
> for (p = username; *p;) {
> *dpb++ = *p++;
> }
> ...

You might want to have a look at http://sourceforge.net/projects/ibpp.
It's free and might save you countless hours of coding directly to the
C-API.
That's a slim C++ layer on top of the C-API.

--
Olivier Mascia