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

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


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

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


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
×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date