Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Strange Error Message
Message
De
27/03/2011 17:42:00
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01504918
Message ID:
01505142
Vues:
61
>>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 ?

The problem I'm seeing is in the SQL_EXECUTE method. None of the "Error Handling Code" is getting called in my situation.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform