Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to call SQL stored procedure in VFP9
Message
From
06/12/2007 23:56:20
Yim Ming Sun Derek
Spacious Design Consultant
Hong Kong, Hong Kong
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01273206
Message ID:
01273829
Views:
21
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform