Question about wxDbTable.SetColDefs()

Ruizhi Ye yeruizhi at gmail.com
Tue Jun 5 09:17:41 PDT 2007


Hi, experts.

I am using wxDb and wxDbTable to write a DB application.

But I feel discommodious when I use wxDbTable.SetColDefs() to get data
from table, for example:

In the table, I write a long[100] into a varbinary column named "data".
Now I want to read these long datas into a long array ( long m_Data[100] ).
----------------------------------------------------
m_tbPerson->SetColDefs(16, wxT("data"), DB_DATA_TYPE_BLOB, m_Data,
SQL_C_WXCHAR, 100*sizeof(long));

this method will read each byte and cast it to char, 0 -> '0'.
----------------------------------------------------
m_tbPerson->SetColDefs(16, wxT("data"), DB_DATA_TYPE_BLOB, m_Data,
SQL_C_ULONG, 100*sizeof(long));
While using this method, the m_tbPerson->Open() return false.
----------------------------------------------------
Could any expert give me some suggestion on SetColDefs?
How could I "copy" this buffer of long data from column in DB, to member array?

Thanks.




More information about the wx-users mailing list