Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strange Error Message
Message
 
To
25/03/2011 18:26:05
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01504918
Message ID:
01505064
Views:
37
>It's not surprising that you're missing something. I made a mistake when I created the example. It should have been
>lcSql = "UPDATE myTable SET myField = ?myValue WHERE pk = ?mypk"
>
>IF oDataClass.prepare(tnConnection,lcSql)
>  ** tnConnection is a valid, pre-existing connection to an ODBC datasource
>  SCAN
>    mypk = table.pk
>    myvalue = table.value
>    IF NOT oDataClass.sql_execute(tnConnection)  
>        ** this is the line that was wrong in the example.  
>        ** You don't pass the SQL when executing a  prepared statement
>     ** Error Handling Code
>    ENDIF
>  ENDSCAN
>ELSE
>  ** Error Handling Code
>ENDIF
>
>***oDataClass.prepare
>LPARAMETERS tnConnection,tcSql
>=SQLPREPARE(tnConnection,tcSql)
>** With appropriate error handling
>
>
>"Is parameter tcSql supposed to be lcSql?"
>
>If you mean have I used the wrong name then no. Each use of lcSql and tcSql is intentional.
>

What is your " ** Error Handling Code"? Is this a single routine, or you have separate error handling code lines in each function?
Where and how do you introduce lnResult variable ?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform