Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Christian Tabligan
  Where is Christian Tabligan?
 Bacolod City, Neg. Occ.
 Philippines
 Christian Tabligan
 To: dragon 5
  Where is dragon 5?
 Johor
 Malaysia
 dragon 5
 Tags
Subject: RE: how to save file to particular location
Thread ID: 268880 Message ID: 268884 # Views: 45 # Ratings: 1
Version: Visual FoxPro 6 Category: VFP and .NET
Date: Thursday, July 15, 2010 8:20:05 AM         
   


> Hi. Sorry for wrong type in the &targetLocateFileType. I have change to &targetLocateFile.
>
>
> I have a cursor, cur_attendanceReport and I want to convert to ms.excel file.
>
> now i using "putfile()" to get the location into the textfield of the txtOutputFileLocation .
> After I get the location, it cannot save the file to the location that I choose, it save to the default location, which is locate at vfp98 folder.
>
> my code is like below:
>
>
> targetLocateFile=''
> targetLocateFile=alltrim(thisform.txtOutputFileLocation.value)
>
>
> select cur_attendanceReport
> copy to &targetLocateFile type xls
>
>
> Thanks.
>
> peng

try this..

PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN

**************************************************
*-- Form:         form1 (c:\frmmain.scx)
*-- ParentClass:  form
*-- BaseClass:    form
*
DEFINE CLASS form1 AS form


	Top = 16
	Left = 44
	Height = 116
	Width = 235
	DoCreate = .T.
	Caption = "Form1"
	Name = "Form1"


	ADD OBJECT command2 AS commandbutton WITH ;
		Top = 60, ;
		Left = 84, ;
		Height = 27, ;
		Width = 84, ;
		Cancel = .T., ;
		Caption = "Save", ;
		Name = "Command2"


	ADD OBJECT txtfilename AS textbox WITH ;
		Value = "C:\MyFolder\MyFile", ;
		Height = 23, ;
		Left = 24, ;
		Top = 24, ;
		Width = 192, ;
		Name = "txtFileName"


	PROCEDURE command2.Click
		set safety off
		create table temp (letter c(1))
		insert into temp values ("A")
		insert into temp values ("B")
		insert into temp values ("C")
		insert into temp values ("D")
		insert into temp values ("E")
		insert into temp values ("F")

		cFileLocation = ALLTR(thisform.txtFilename.value)
		IF !DIRECTORY(JUSTPATH(cFileLocation))
		   MD JUSTPATH(cFileLocation)
		ENDIF
		copy to (cFileLocation) type xls
	ENDPROC


ENDDEFINE
*
*-- EndDefine: form1
**************************************************


Best Regards,

CriZ (,")

"Happiness is real when shared."

ENTIRE THREAD

how to save file to particular location Posted by loo peng @ 7/15/2010 7:58:06 AM
RE: how to save file to particular location Posted by Christian Tabligan @ 7/15/2010 8:20:05 AM
RE: how to save file to particular location Posted by Jun Tangunan @ 7/15/2010 10:10:18 AM
RE: how to save file to particular location Posted by Christian Tabligan @ 7/15/2010 10:30:49 AM
RE: how to save file to particular location Posted by Glen Villar @ 7/15/2010 10:36:32 AM
RE: how to save file to particular location Posted by Christian Tabligan @ 7/15/2010 10:53:47 AM
RE: how to save file to particular location Posted by loo peng @ 7/15/2010 10:48:26 AM
RE: how to save file to particular location Posted by Christian Tabligan @ 7/15/2010 10:54:31 AM
RE: how to save file to particular location Posted by Tom Saddul @ 7/15/2010 8:28:22 AM
RE: how to save file to particular location Posted by Samir H. @ 7/15/2010 9:12:33 AM
RE: how to save file to particular location Posted by loo peng @ 7/15/2010 10:47:29 AM
RE: how to save file to particular location Posted by Tamar Granor @ 7/15/2010 10:54:50 PM