Kevin,
You don't have to put a SQL Stored Procedure up to get the query returned. Look at the following VFP Statements for doing SQL queries which return a cursor which you can then copy to a table if you need to:
SQLCONNECT([DataSourceName, cUserID, cPassword | cConnectionName]) - Returns a numeric session identifier for your connection thru an ODBC Definition.
SQLEXEC(nConnectionHandle, [cSQLCommand, [CursorName]]) - Returns a VFP Cursor that you can manipulate and copy to a table if necessary. Your cSQLCommand must not contain variables so you need to build your character string with absolute values. For instance
cSQLCommand = [SELECT * FROM Table WHERE cField = '] + cVariable + [']
HTH,
Bill
>This might be a stupid question, but...
>
>Let's say I have an invoice history file in SQL Server. I also have a VFP front-end that allows someone to select accounts and products to query/report against.
>
>So the user picks 10 accounts and 3 items to report on. (Though the user could just as easily pick 100 accounts and 100 items.) This list could be stored in a set of arrays, or in a cursor, DBF, recordset, etc.
>
>How would I 'get' this list of 10 accounts and 3 items to a SQL Server Stored Procedure, so that a SP could query the invoice history file and return the results?
>
>Sorry if this question is so basic, but there's just so much about visibility, architecture of this stuff that I'm trying to learn.
>
>Also, is anyone aware of VFP sample code for working with stored procedures in SQL Server?
>
>Thanks in advance,
>Kevin
CySolutions, Medical Information Technology
You're only as good as your last
success, so . . .If it works. . .don't fix it!