Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to call SQL stored procedure in VFP9
Message
De
06/12/2007 23:56:20
Yim Ming Sun Derek
Spacious Design Consultant
Hong Kong, Hong Kong
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01273206
Message ID:
01273829
Vues:
19
Hi
I hava a store procedure to select a range of invoice no. from a table.
CREATE PROCEDURE [dbo].[FindInvoice]
      @DF varchar(255),
      @DT varchar(255),
AS
BEGIN
      SET NOCOUNT ON;
      DECLARE @TABLEID varchar(255)
      DECLARE @Sqlstat varchar(255) 
      SELECT @Sqlstat = 'SELECT [Invoice No],Date FROM INVTBL Where date between convert(datetime,''' + @DF + ''',101) and convert(datetime,''' + @DT + ''',101) 
      EXEC (@Sqlstat)
 
END
 
Then I call the store procedure in VFP as follow
STORE SQLCONNECT('vitalscan', 'sa', 'Wilson123') TO gnConnHandle
IF gnConnHandle <= 0
   = MESSAGEBOX('Cannot make connection', 16, 'SQL Connect Error')
ELSE
   = MESSAGEBOX('Connection made', 48, 'SQL Connect Message')
  lnRetVal = SQLEXEC(gnConnHandle, [EXEC FindInvoice '03/12/2007', '03/12/2007'])
=SQLCANCEL(gnConnHandle)  
   = SQLDISCONNECT(gnConnHandle)
ENDIF
How can I put the result set into a cursor or table in VFP ?

Derek
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform