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

fileSystemObject - Question!

Status
Not open for further replies.

KSiva

Programmer
Feb 18, 2002
63
AU
Hello Gurus!

I have written a python script (a client GUI tool to access the SQL server database). When client uploads a file, it need to be created in server side. I used the below code (found on this site):

CREATE PROCEDURE [dbo].[sp_CreateTextFile]
@FileName varchar(100),
@FileContent varchar(8000)

AS
Declare @FSO int
Declare @TextFile int
Declare @hr int

EXEC @hr = sp_OACreate 'Scripting.FileSystemObject', @FSO OUT
EXEC @hr = sp_OAMethod @FSO, 'CreateTextFile', @FileName,NULL, @TextFile OUT
EXEC @hr = sp_OAMethod @TextFile, 'WriteLine', @fileContent, NULL
EXEC @hr = sp_OADestroy @FSO
GO

and it works fine, but creates the file in the client side. I am passsing the filename to be created and content of the file. Is that what supposed to be happen? I have been reading the filesystemObject doc and it reads that the file must be created in server side.

I am bit lost here ... Can any of you help me???

Thanks a lot! Sivakumar Kandaraj :)
System Administrator,Web Programmer
Melbourne
Australia.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top