Subject | Re: [firebird-support] error using DPB |
---|---|
Author | Francesco Lamonica |
Post date | 2003-09-22T12:43:08Z |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hash: SHA1
On Sunday 14 September 2003 01:37, Francesco Lamonica wrote:
> there's a problem in the following code
>
> int
> FBWrapper::attach()
> {
> char *str="testdb.gdb"
> char dpb_buffer[256], *dpb;
> char uname[256]="sysdba",passwd[256]="masterkey";
> short dpb_length;
>
> dpb=dpb_buffer;
> *dpb++=isc_dpb_version1;
> dpb_length=dpb-dpb_buffer;
Changin the following lines
> dpb=dpb_buffer;
> isc_expand_dpb(&dpb,&dpb_length,isc_dpb_user_name,uname,isc_dpb_password,pa
>sswd,NULL);
To
*dpb++=isc_dpb_user_name;
*dpb++=strlen(uname);
for(p=uname;*p;)
*dpb++=*p++;
*dpb++=isc_dpb_password;
*dpb++=strlen(passwd);
for(p=passwd;*p;)
*dpb++=*p++;
dpb_length=dpb-dpb_buffer;
> isc_attach_database(status_vector,strlen(str),str,&dbh,dpb_length,dpb_buffe
>r);
>
> return check4errors();
> }
>
made my app work... so far so good.. but i am wondering what is the difference
between the 2 codes
- --
Francesco Lamonica: f DOT lamonica AT tin DOT it
PGP Fingerprint: 5870 92BA 8DFF 1ACF DE2E B94D 46EC 5505 7C64 4EF1
Favourite quote: There's no spoon
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
iD8DBQE/bu5cRuxVBXxkTvERAhkFAKDgPMT5d94ltcB27EVGp1t8QF8p3wCdHbRl
udMPspq6V80EPEind4PIRfc=
=uSWi
-----END PGP SIGNATURE-----