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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File create with a stored procedure

Status
Not open for further replies.

crabgrass

Technical User
Aug 29, 2007
111
US
I have a stored procedure like so
Code:
function createexcel
filespec = (justpath(dbf())+ "../output/sampleout") 
select * from sites into table (filespec)
use (filespec)
filespec = (justpath(dbf())+ "../output/sampleout2") 
copy to (filespec) type xl5
return filespec
endfunc
When run from VFP the code will work fine and both files will be created. However when run from an ASP page the code fails with an error that says "feature not available". If I remove the "copy to " line it will work OK from ASP so I know the file permissions are OK. Any ideas what's happening here? btw- CREATE TABLE also works but my need is for the excel file.
 
Crabgrass,

What method are you using to access VFP from your ASP page? Are you using ODBC? Or OLE DB?

There is an interesting discussion on what you can and cannot do with the VFP ODBC driver, at including a specific mention of COPY TO .. XL5 (but it doesn't answer your question).

If you are using ODBC, it might be worth trying to use the VFP OLE DB provider instead, as this is more reliable and up to date.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
I'm using the VFP driver.
Code:
dim oConn
Set oConn = Server.CreateObject("ADODB.Connection")
ConnStr = "Provider=VFPOLEDB;Data source=" & session("fileloc") & "contactmanager.dbc" 
with oConn
	 .Mode = 16 'adModeShareDenyNone - this is value of adModeShareDenyNone constant
	 .Open ConnStr
	 .CursorLocation = adUseClient
	 .Execute ("set null off")
end with

Thanks for the tip. I'll check it out.
 
As an aside, we had an instance in our shop where 'COPY TO...' wouldn't work in an exe due to the default data session being EXCLUSIVE. It would work fine in the IDE environment though, because EXCLUSIVE was off in developement mode.

You may want to try shutting exclusive off and see if it helps any.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Thanks for the idea. Unfortunately it doesn't help. I still get a "Feature not available" error.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top