Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / What happen when i called wxDatabase Object, but prompt me error

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

  
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. What happen when i called wxDatabase Object, but prompt me error
#2585
Posted by: mooncake 2003-08-31 10:02:02
#include "wx/odbc.h"

void MyApp::ConnectDB() {
     wxDatabase Database;

}

error message is:

'wxDatabase' undeclared (first use this function)


Thank you.



Post Edited (08-31-03 10:06)
Meow~
Message2. Re: What happen when i called wxDatabase Object, but prompt me error
#2586
Posted by: guidance 2003-08-31 13:02:04
Try wxDb instead:
http://g.yi.org/_scripts/file.php?f=10508&r=106
Message3. Re: What happen when i called wxDatabase Object, but prompt me error
#2587
Posted by: mooncake 2003-08-31 15:59:37
i getting blur...
what is the different between wxDB and wxODBC?

do you have any example?

whats going on with this, when i called like this?

wxDb *dbms;

     if (dbms->isOpen()) {
            ...    
     }

it prompt me:  "no matching function for call to "wxDB::isOpen()" ?

Thank you

Meow~
Message4. Re: What happen when i called wxDatabase Object, but prompt me error
#2588
Posted by: guidance 2003-08-31 16:35:29
That link is to wxDatabase doc, have you checked?

 "A much more robust and feature-rich set of ODBC classes is now available and recommended for use in place of the wxDatabase class.

See details of these classes in: wxDb, wxDbTable"

Doc says, IsOpen(), not isOpen().
Message5. Re: What happen when i called wxDatabase Object, but prompt me error
#2589
Posted by: mooncake 2003-08-31 16:39:42
Wow... case sensitive... @@"

so, it seems like wxDB powerful than wxODBC?

Thank you.

Meow~
Message6. Re: What happen when i called wxDatabase Object, but prompt me error
#2590
Posted by: mooncake 2003-08-31 17:13:46
class odbcSQL {
private:
        wxDb *dbms;
};

.....
...

    if (!dbms->ExecSql(sqlString.c_str())){
        countRow=0;
        return countRow;
    }

why it prompt me this error message ?
[Link Error] undefined reference to wxDb::ExecSql(wxString const&)"

Thank you.
Meow~
Message7. Re: What happen when i called wxDatabase Object, but prompt me error
#2591
Posted by: guidance 2003-08-31 17:26:18
".c_str" is not necessary.
Don't know what's wrong actually this time if your lib is OK.
Message8. Re: What happen when i called wxDatabase Object, but prompt me error
#2592
Posted by: mooncake 2003-08-31 18:56:50
removed, but, still same.  :(

forgot tell you, dbms->Open("mysql","name","password");  cant run also, same problem with ExecSQL

sigh...

Thank you



Post Edited (08-31-03 19:43)
Meow~
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
¥738.00 ·
 
 
¥1,280.00 ·
 
 
¥1,370.00 ·
 
 
¥1,580.00 ·
 
 
¥287.00 ·
 
 
¥920.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0