Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ODBC DRiver
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00456591
Message ID:
00456805
Views:
22
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform