R: [wx-dev] May be a Bug/limitation! of "wxDbTable::Insert" (SOLUTION!!!)

Baldassarre Cesarano baldassarre.cesarano at eunics.it
Tue Jun 5 02:06:50 PDT 2007


Hi Igor, =

Writing the answer to your mail, I have found the solution! =

 =

In the metod "wxDbTable::Insert" (dbtable.cpp) the second calling to
"SQLParamData" can return the code 99 (SQL_NEED_DATA)
that is not contemplated in the next "if".
 =

Then you can replace the code:
            retcode =3D SQLParamData(hstmtInsert, &pParmID);
            if (retcode !=3D SQL_SUCCESS &&
                retcode !=3D SQL_SUCCESS_WITH_INFO)
            {
with
            retcode =3D SQLParamData(hstmtInsert, &pParmID);
            if (retcode !=3D SQL_SUCCESS &&
                retcode !=3D SQL_NEED_DATA &&
                retcode !=3D SQL_SUCCESS_WITH_INFO)
            {

Ciao
    Baldo
 =

 =

 =

P.S.
    ACCESS support blob (LONGBINARY, BINARY, MEMO, "OLE Object").
    Yes I use Win XP with standard ODBC drivers.
 =

 =

  _____  =


Da: Igor Korot [mailto:ikorot at earthlink.net] =

Inviato: marted=EC 5 giugno 2007 8.06
A: wx-dev at lists.wxwidgets.org; wx-dev at lists.wxwidgets.org
Oggetto: Re: [wx-dev] R: [wx-dev] May be a Bug/limitation! of
"wxDbTable::Insert"



Hi,

Sorry for the delayed reply....

I don't think ACCESS supports BLOB data type... ;-)

In regards to MS SQL Server: I'm assuming that it's a run-time error...

What error do you get? I.e what is the error message says.

Also, I'm assuming you have a DSN that points to you database.

Are you using DSN or DNS-less connection?

I'm also assuming that it's on WinXP using standard Windows ODBC
manager/driver....

 =


Thank you.






-----Original Message----- =

From: Baldassarre Cesarano =

Sent: Jun 1, 2007 1:33 AM =

To: wx-dev at lists.wxwidgets.org =

Subject: [wx-dev] R: [wx-dev] May be a Bug/limitation! of
"wxDbTable::Insert" =



I have tested MS-Access 2003 and MS-SQL Server 2000
 =


Please note: You can reproduce the error modifying the code of the example
in =

=93Database classes overview=94
(http://www.wxwidgets.org/manuals/stable/wx_odbcoverview.html)
with these modifications:
 =

----------------------------------------------------------------------------
----------------------------------------
....
 const UWORD  numTableColumns =3D 4;       // Number table columns
......
 byte   Blob1[100];
 byte   Blob2[100];
 for( int i=3D0; i< sizeof(Blob1); i++ ){
  Blob1[i] =3D i+1;
  Blob2[i] =3D i+10;
 }
......
 table->SetColDefs(2, wxT("BlobboUno"), DB_DATA_TYPE_BLOB,  Blob1,
SQL_C_BINARY, sizeof(Blob1),  false, true);
 table->SetColDefs(3, wxT("BlobboDue"), DB_DATA_TYPE_BLOB,  Blob2,
SQL_C_BINARY, sizeof(Blob2),  false, true);
......

----------------------------------------------------------------------------
--------------------
 The error will appear with the instruction "table->Insert()".
 =

 =

Ciao
    Baldo

  _____  =


Da: Igor Korot [mailto:ikorot at earthlink.net] =

Inviato: gioved=EC 31 maggio 2007 20.53
A: wx-dev at lists.wxwidgets.org; wx-dev at lists.wxwidgets.org
Oggetto: Re: [wx-dev] May be a Bug/limitation! of "wxDbTable::Insert"



Hi,

What database are you using?

How exactly the insertion fail: crash, does not execute....

If it crashes, what s the error message you see?

 =


Thank you.






-----Original Message----- =

From: Baldassarre Cesarano =

Sent: May 31, 2007 7:58 AM =

To: wx-dev at lists.wxwidgets.org =

Subject: [wx-dev] May be a Bug/limitation! of "wxDbTable::Insert" =



Hi everyone,
wxWindows release 2.8.4 =

S.O......: (XP)
 =

I've create a table with ExecSql containing a first column type LONGBINARY
and another type BINARY.
The creation is ok (ExecSql) but the insertion (with wxDbTable::Insert)
fail.
 =

If I omit the creation of 1 field the insertion is ok.
 =

Note: I have tryed with ani combination of =

 LONGBINARY/LONGBINARY
 LONGBINARY/BINARY
 LONGBINARY/MEMO
 =

Someone knows if the ODBC/wxWidgets is limited for the number of fields type
(long)binary/memo?

Tnx
    Baldo
 =


--------------------------------------------------------------------- To
unsubscribe, e-mail: wx-dev-unsubscribe at lists.wxwidgets.org For additional
commands, e-mail: wx-dev-help at lists.wxwidgets.org =


--------------------------------------------------------------------- To
unsubscribe, e-mail: wx-dev-unsubscribe at lists.wxwidgets.org For additional
commands, e-mail: wx-dev-help at lists.wxwidgets.org =

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wx-dev/attachments/20070605/6f288=
631/attachment.htm


More information about the wx-dev mailing list