List:MySQL++« Previous MessageNext Message »
From:Pitu Caleya Date:December 8 2004 1:31am
Subject:Re: Problem with Visual Studio .Net 2003
View as plain text  
Maybe didn't say what i had wanted to say (i forgot the & operator and my 
english is not good enough):

The problem is that when i try to execute this code:

sql_create_3 (table, 1, 3, unsigned int id, CString name, CString info);
...
Query query = connection.query ();
table row;
row.set (1, name, info);
query.insert (row);  <---------

When Query::insert is called, this is the secuence of procedure calls:

Query::insert
SQLQuery::insert

In the last one, we can find the following code:

template <class T> SQLQuery& insert(const T &v) {
  reset();
  *this << "INSERT INTO " << v.table() << " (" << v.field_list()
          << ") VALUES (" << v.value_list() << ")";
   return *this;
}

The problem is that the result should be:
"INSERT INTO table VALUES(id,name,info) VALUES (1,'Item1','Description1')"

But I obtain:
"0045A884table VALUES(id,name,info) VALUES (1,'Item1','Description1')"

I suppose the 0045A884 is the result of considering the constant string 
"INSERT INTO " as a void *, because, when I trace the code, the _Myt& 
ostream::operator<<(const void *_Val) is called. Any idea?


Thread
Problem with Visual Studio .Net 2003Pitu Caleya2 Dec
  • Re: Problem with Visual Studio .Net 2003Warren Young2 Dec
    • Re: Problem with Visual Studio .Net 2003Warren Young6 Dec
Re: Problem with Visual Studio .Net 2003Pitu Caleya7 Dec
  • Re: Problem with Visual Studio .Net 2003Warren Young7 Dec
    • Re: Problem with Visual Studio .Net 2003Pitu Caleya8 Dec
Re: Problem with Visual Studio .Net 2003Warren Young9 Dec
Re: Problem with Visual Studio .Net 2003Pitu Caleya9 Dec
  • Re: Problem with Visual Studio .Net 2003Warren Young10 Dec
    • Re: Problem with Visual Studio .Net 2003Pitu Caleya10 Dec