Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing Parameters to SQL Server
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00851909
Message ID:
00851920
Vues:
8
Bob,

You've to check return value from SQLEXEC(). If it's -1, than there was ODBC error and you should use AERROR() function to get detailed info about it.

>Hi All,
>
>I must be totally clueless today... I have a Stored Proc that
>is defined as:
>
>
>CREATE PROCEDURE dbo.sp_bob (@cState as Char(2))
>AS
>    BEGIN
>       Select * from Accudata where State = @cState
>    END
>
>
>And I am trying to call it from VFP 7 like this:
>
>
>tcSqltext = "Exec sp_bob 'NY'"
>lnConnect = SQLCONNECT(cODBC_name, cOdbc_login, cOdbc_password)
>
>IF lnConnect <= 0
>   lnReturn = 0
>   = MESSAGEBOX('Cannot make connection', 16, 'SQL Connect Error')
>ELSE
>   lnReturn = SQLEXEC(lnConnect, tcSqlText, tcCursorName)
>   =SQLDISCONNECT(lnConnect)
>ENDIF
>
>
>It doesnt work from VFP, but it works fine from the SQL Query Anaylizer..
>
>If anyone could help, I'd appreciate it...
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform