Subject | Re: [ib-support] isc_expand_dpb |
---|---|
Author | Andy Canfield |
Post date | 2001-07-21T11:58:54Z |
(Feeling a little slow these days)...
The documentation describes what the dbp (array) is supposed to contain. The isc_expand_dpb() function call is supposed to fill it for you. It took me several days to give up on isc_expand_dpb(); it is now anti-recommended. It took me an hour to write my own code to fill in the array myself. Here is a copy and paste of my source code, working for six months now:
char DbParmBuffer[ 256 ];
short DbParmLength;
char * Src;
char * DbPtr;
DbPtr = DbParmBuffer;
*DbPtr++ = isc_dpb_version1;
*DbPtr++ = isc_dpb_user_name;
*DbPtr++ = strlen( DbUserName );
for ( Src = DbUserName;
( *DbPtr = *Src ) != 0;
++DbPtr, ++Src );
// note strings in the buffer don't end with a NUL byte
*DbPtr++ = isc_dpb_password;
*DbPtr++ = strlen( DbPassword );
for ( Src = DbPassword;
( *DbPtr = *Src ) != 0;
++DbPtr, ++Src );
DbParmLength = DbPtr - DbParmBuffer;
The documentation describes what the dbp (array) is supposed to contain. The isc_expand_dpb() function call is supposed to fill it for you. It took me several days to give up on isc_expand_dpb(); it is now anti-recommended. It took me an hour to write my own code to fill in the array myself. Here is a copy and paste of my source code, working for six months now:
char DbParmBuffer[ 256 ];
short DbParmLength;
char * Src;
char * DbPtr;
DbPtr = DbParmBuffer;
*DbPtr++ = isc_dpb_version1;
*DbPtr++ = isc_dpb_user_name;
*DbPtr++ = strlen( DbUserName );
for ( Src = DbUserName;
( *DbPtr = *Src ) != 0;
++DbPtr, ++Src );
// note strings in the buffer don't end with a NUL byte
*DbPtr++ = isc_dpb_password;
*DbPtr++ = strlen( DbPassword );
for ( Src = DbPassword;
( *DbPtr = *Src ) != 0;
++DbPtr, ++Src );
DbParmLength = DbPtr - DbParmBuffer;
----- Original Message -----
From: "Rado Benc" <bego@...>
To: "Ib-Support" <ib-support@yahoogroups.com>
Sent: Thursday, July 19, 2001 13:29
Subject: [ib-support]
> Dear all,
>
> as far as I remember, there was a discussion about
> isc_expand_dpb API call, and there were suggestions
> not to use the call in the future (due to some memory
> issues).
>
> Which is the preferred way to connect the database
> with user name and password specified? Environment
> settings (ISC_USER, ISC_PASSWORD) are not a good
> solution for me.
>
> Is there another API call I am missing?
>
> Thanks in advance,
>
> Rado
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>