|
|
Choosing A Webhost: |
RE: ODBC prepared statements to sybase 12.5 not working: msg#00146db.tds.freetds
Heres the source inline... I couldn't see the attachment on the list for some reason. #include <string> #include <memory> #include <iostream> #include <odbc++/drivermanager.h> #include <odbc++/databasemetadata.h> #include <odbc++/connection.h> #include <odbc++/preparedstatement.h> #include <odbc++/resultset.h> using namespace std; // test database prepares int main(int argc, char** argv) { if ( argc < 4 ) { cerr << "Not enough arguments" << endl; return 1; } try { // Connect to DB odbc::Connection* conn = odbc::DriverManager::getConnection(argv[1], argv[2], argv[3]); odbc::DatabaseMetaData* md = conn->getMetaData(); assert(md); cerr << "Connected to " << md->getDatabaseProductName() << " " << md->getDatabaseProductVersion() << " using " << md->getDriverName() << " " << md->getDriverVersion() << " (ODBC Version " << md->getDriverMajorVersion() << "." << md->getDriverMinorVersion() << ")" << endl; conn->setAutoCommit(0); cerr << "creating statement" << endl; auto_ptr<odbc::PreparedStatement> stmt( conn->prepareStatement("select name from sysusers " "where name like ?")); cerr << "statement created" << endl; for (int i = 1; i< 20; ++i) { stmt->setString(1, "%role"); cerr << "getting result set" << endl; auto_ptr<odbc::ResultSet> rs(stmt->executeQuery()); cerr << "got result set" << endl; int count = 0; while(rs->next()) { std::string name = rs->getString(1); count++; } cerr << "execute " << i << " got " << count << " rows" << endl; } } catch(const odbc::SQLException& ex) { cerr << ex.getMessage() << endl; return -1; } return 0; } On Thu, 2003-08-07 at 11:22, Alex Hornby wrote: > > > > Hi Alex. > > This is very strange... > > Could you send a code snip for reproducing the problem ? > > > > freddy77 > > Heres a libodbc++ program that shows the problem - its looks like its > statement option related. > > Its only requirement is libodbc++ 0.2.3 which you can pick up from: > > http://sourceforge.net/project/showfiles.php?group_id=19075 > > To run it give DSN, user and password on the command line. > > Cheers, > Alex.
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: ODBC prepared statements to sybase 12.5 not working, Alex Hornby |
|---|---|
| Next by Date: | Question about libtds and 'delete from', James Vanns |
| Previous by Thread: | RE: ODBC prepared statements to sybase 12.5 not working, Alex Hornby |
| Next by Thread: | RE: ODBC prepared statements to sybase 12.5 not working, Alex Hornby |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |