Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / porblem with wxDbTable

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. porblem with wxDbTable
#5050
Posted by: hailang_82 2004-09-03 11:40:09
Hi,

It's me again .... sigh... been trying to solve tis prob for the past few days...

I use wxDbConnectInf to open a connection to the database.
and use wxDb to make an instance of the ODBC connection...

The main pt here is I get into the postgresql database successfully.

I try to create a table by initialising wxDbTable. after typing in the sql statement, I managed to retrieve the number of rows of data... but not the data itself..

upon using the code...

table->Open();

if(table->Open()==false)
{
    wxMessageBox("Open not table", "Table not opened", wxOK | wxICON_EXCLAMATION);
}


An error box pop up saying that the table is not open. So wat exactly is the problem??


Is the problem lies on the fact that the columns are not bind corectly?
Message2. Re: porblem with wxDbTable
#5051
Posted by: hailang_82 2004-09-03 14:49:14
My code....... not including initialising the table....


table->Open();
   
   
    if(table->Open()==false)
{
    wxMessageBox("Open not table", "Table not opened", wxOK | wxICON_EXCLAMATION);
}

table->SetFromClause("");
table->Query();
if(table->Query()==false)
{
    wxMessageBox("No query", "No queries", wxOK | wxICON_EXCLAMATION);
}

wxString msg;

while (table->GetNext()!=false)
{
msg.Printf("#%u, #%s",table->GetRowNum(),&orgname);
wxMessageBox(msg, "Data", wxOK | wxICON_INFORMATION, NULL);

}


I managed to get the messagebox... Table not opened... but nv get error from query... but i nv manage to print/show out any data...

So my table is not opened... but my query was performed successfully... so is my error due to insufficient privileges or unable to bind columns?


Can anyone helped me?
thanks ahz

 
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
¥289.00 ·
 
 
¥1,080.00 ·
 
 
¥1,380.00 ·
 
 
¥638.00 ·
 
 
¥1,290.00 ·
 
 
¥1,420.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0