Subject Re: API vs ISQL problems
Author edcurren
Hi Dimitry,
Thanks for taking the time to reply. I appreciate your guidance.

> > dpb = dpb_buffer;
> > /* Add user name and password to DPB. */
> > isc_expand_dpb(&dpb, &dpb_length, isc_dpb_user_name,
> >m_AdminDbUser, isc_dpb_password, m_AdminDbPass, NULL);
>
> At first, isc_expand_dpb is deprecated (read - forbidden) to use.

Okay, where can I find lists of depricated functions? I've been
reading the API 6.0 guide to get myself up to speed on things, and
that documentation uses isc_expand_dpb.

> >When I run the same INSERT statement against the same database in
ISQL
> >it works without any errors at all.
>
> Sorry, but I can't believe it.
You will have to come and tell my computer that. It still doesn't
know it can't do it :)

Thanks for your help.

> > if( isc_dsql_execute_immediate(status, &hDb, &hTx, 0, stmt,
> >3, NULL) )
>
> Note dialect 3 here. Do you still don't understand what is wrong?
> Read more about quoted identifiers in dialect 3.
Yes, I had been mucking around with the code. There were probably
more than a few things wrong with what I posted.

--- In firebird-support@yahoogroups.com, "Dimitry Sibiryakov"
<SD@t...> wrote:
> On 26 May 2005 at 19:27, edcurren wrote:
>
> > dpb = dpb_buffer;
> > /* Add user name and password to DPB. */
> > isc_expand_dpb(&dpb, &dpb_length, isc_dpb_user_name,
> >m_AdminDbUser, isc_dpb_password, m_AdminDbPass, NULL);
>
> At first, isc_expand_dpb is deprecated (read - forbidden) to use.
>
> > char *stmt = new char[1024];
> > strcpy(stmt, "INSERT INTO Users (UserName, UserPassword)
> >VALUES ('");
>
> Note double quote here.
>
> > if( isc_dsql_execute_immediate(status, &hDb, &hTx, 0, stmt,
> >3, NULL) )
>
> Note dialect 3 here. Do you still don't understand what is wrong?
> Read more about quoted identifiers in dialect 3.
>
> >When I execute it I receive the following:
> >Dynamic SQL Error
> >SQL Error code = -204
> >Table unknown
> >USERS
>
> Are you sure that your table was defined as Users and not "Users"?
>
> >When I run the same INSERT statement against the same database in
ISQL
> >it works without any errors at all.
>
> Sorry, but I can't believe it.
>
> >Can someone guide me as to what is wrong here?
>
> Quotes, IMHO.
> --
> SY, Dimitry Sibiryakov.