Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ODBC DRiver
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00456591
Message ID:
00456805
Vues:
24
>Hi All:
> I am using Microsoft ODBC driver from my fox app. I am getting an ODBC driver error. The error reads "Too few Parameters. Expected 2"
>Here is my code.
>
>lcsql = "UPDATE jcjob SET jcjob.name = " + CHR(34) +  ;
>         ALLTRIM(cCoName) + CHR(34) + ;
>         " where jcjob.jobnum = " + Alltrim(nCoIId)
>
>         IF sqlprepare(lnhandle,lcsql)>0
>            IF sqlexe(lnhandle) > 0
The error is sqlexe(lnhandle). You should have already tested to see if you have a valid connection handle. Plus, you do this without doing it in a SQLExec() function.
IF lnhandle < 1  && bad handle, no connection
    return .f.
ENDIF
lcsql = "UPDATE jcjob SET jcjob.name = " + CHR(34) +  ;
         ALLTRIM(cCoName) + CHR(34) + ;
         " where jcjob.jobnum = " + Alltrim(nCoIId)
IF sqlprepare(lnhandle,lcsql) > 0
   && execute sql here and other code
   lnRetVal = SQLEXEC(lnHandle)
   if lnRetVal < 0
      && SQL Update Failed
   else
      && SQL Update Succeeded
   endif
ENDIF
Mark McCasland
Midlothian, TX USA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform