MySQL Forums
Forum List  »  Connector/C++

Re: error C2259 on Visual C++ Express 2008
Posted by: Ricardo Ferreira
Date: April 22, 2009 04:02PM

ok problem solved.

The MySQL_Connection is abstract actually, or at least it seems so, the same error was being reported by the compiler. The problem was, I had this class:

class MySQLConn
{
private:
	sql::Driver *driver;
	sql::Connection *conn;
	sql::ResultSet *rset;
	sql::Statement *stat;
	std::string query;

public:
	MySQLConn(){};
	MySQLConn(string,string,string,string,string);
	void ExecQuery(string);
	vector<vector<string> > FetchValorCol(string);	
	vector<vector<string> > FetchValorRow(int,int);	

};

and I was initializing the Connection pointer (conn) like this:

conn = new Connection(driver->connect(ip+port,user,pass));

and when I changed it to:

conn = driver->connect(ip+porta,user,pass);

it worked!

So my final question is, can't I use "new" on a pointer to an abstract class?

ps.: thanks Ulf (a.k.a Internet Super Hero :P), your guides on your website are great!



Edited 1 time(s). Last edit at 04/22/2009 04:03PM by Ricardo Ferreira.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: error C2259 on Visual C++ Express 2008
3009
April 22, 2009 04:02PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.