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




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to