Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

syntax for executing stored procedure 1

Status
Not open for further replies.

2969

IS-IT--Management
Oct 18, 2001
107
US
hi

can anyone guide mw what's the syntax for executing stored proc thru vb..
thx
TA
 
HI
I am providing the copy of the VFP7 help file syntax..
*******************************************************
Use the SQLEXEC( ) function with the stored procedure name.
For example, the following code displays the results of calling a stored procedure named sp_who on SQL Server using an active connection to the data source sqlremote:

nConnectionHandle = SQLCONNECT('sqlremote')
? SQLEXEC(nConnectionHandle, 'use pubs')
? SQLEXEC(nConnectionHandle, 'sp_who')
BROWSE
*******************************************************
Hope this helps you. :) ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK :)
 
If you need VB code, you need to post in a VB forum. But the premise of executing a VFP stored procedure (Using ADO,DAO,etc) is the same as any other data source.

Set oConn = CreateObject("ADODB.Connection")
Set oRS = CreateObject("ADODB.Recordset")
Set oCmd = CreateObject("ADODB.Command")

oConn.ConnectionString="Provider=VFPOLEDB.1;Data Source=C:\path\testdata.dbc"
oConn.Open
Set oCmd.ActiveConnection = oConn
oCmd.CommandText = "MyStoredProcedureName"
oCmd.CommandType = 4 && SP
Set oRS = oCmd.Execute()

FWIW, I havent used the new VFP Provider, but maybe someone else could comment on their findings as to what all it supports. Jon Hawkins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top