Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Visual FoxPro
Expertise: Beginner
Dec 23, 1999

FoxPro Commands and the ODBC Driver

Question:
I'm trying to set up an SQL call (in ColdFusion) to a program (TESTOUT.PRG) that uses the FoxPro COPY TO command and user-supplied parameters to output the desired file type:
 
SELECT testout('USER','XLS') as test FROM MyTable
WHERE user='USER'
It doesn't work. The driver (ver. 6) reports "Feature not available," yet the command is listed as available in the driver help file.

Help! I really need to provide this feature to my users. Are there any alternative solutions?

Answer:
The ODBC driver cannot execute FoxPro programs (which is what testout() is); that is why the feature is unavailable. I am not very familiar with ColdFusion but I would bet that you could create a VFP COM server that you could pass an ID to generate as a file:

 
x=createobject("MyServer.TestOut")
SELECT id ;
    FROM MyTable ;
    WHERE User="USER"
    INTO ARRAY laUsers

FOR I = 1 TO ALEN(laUsers,1)    
    x.Convert(laUsers[I],"USER","XLS")
ENDFOR
DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date