List:General Discussion« Previous MessageNext Message »
From:Mateus Begossi Date:June 6 2002 6:49pm
Subject:Re: SQLPrepare problems
View as plain text  
Problem Solved.

Thx!
Mateus Begossi


----- Original Message -----
From: Mateus Begossi <begossi@stripped>
To: <win32@stripped>; MySQL List <mysql@stripped>
Sent: Wednesday, June 05, 2002 10:27 PM
Subject: SQLPrepare problems


> Hello everyone,
> I´m writing a VC++ 6.0 App that among many other things manages a simple
> mySQL database, using myODBC v3.51. Righ now I´m trying to send a "test"
> simple statement to the database, using SQLPrepare:
> retcode = SQLPrepare(hstmt,"INSERT INTO ger(manuf,model,location)
> VALUES(?,?,?)", SQL_NTS);
>
> This is quite similar to one of the myODBC manual´s example. However, the
> VC++ 6.0 compiler gives me the following error:
> "error C2664: 'SQLPrepare' : cannot convert parameter 2 from 'char [52]'
to
> 'unsigned char *'
>         Types pointed to are unrelated; conversion requires
> reinterpret_cast, C-style cast or function-style cast"
>
> I tried to typecast the "INSERT.. " string with (unsigned char*):
> retcode = SQLPrepare(hstmt,(unsigned char*)"INSERT INTO
> ger(manuf,model,location) VALUES(?,?,?)", SQL_NTS);
>
> Which seemed to be fine, but despite compiling and linking alright, it
> really doesnt work and retcode returns an error.
>
> I know that myODBC is working because I already tested Direct Execution
> (SQLExecDirect) with sucess. So, what may I be doing wrong?
>
> Thanks in advance,
> Mateus Begossi
>
>
>
>
> ---------------------------------------------------------------------
> Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
> posting. To request this thread, e-mail win32-thread9044@stripped
>
> To unsubscribe, send a message to the address shown in the
> List-Unsubscribe header of this message. If you cannot see it,
> e-mail win32-unsubscribe@stripped instead.
>
>

Thread
SQLPrepare problemsMateus Begossi6 Jun
Re: SQLPrepare problemsMateus Begossi6 Jun