Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 25th, 2004, 03:42 AM
Authorized User
 
Join Date: Oct 2004
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to kiwibey
Default how to copy filename to text file.....

hi everybody...
is me again...
hahaha....:D
my supervisor now asking me to copy all the filename from one folder to a text file or insert into database..
it's becasue his system will generate a log file for what document had print. so after that we need use two text file to make comparition...
if any filename mismatch then response. write in the page. so that mean the document is not printed yet
so need to re-print again....
after this save all mismatch filename to a log file as a backup info..
thats all.....
thank you for your help.......

bey
 
Old November 25th, 2004, 02:53 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi bey,

By now, you should be comfortable using FSO. Try to code that yourself and post here if you face any problems.

Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old November 26th, 2004, 04:20 AM
Authorized User
 
Join Date: Oct 2004
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to kiwibey
Default

hi Vijay G,
thank you so much.....
finally i can solve this problem yet..........
but now i facing new problem now.....
can i give user select which folder there want ( mean insert a variable in )
<set fo=fs.GetFolder("C:\bey\datachecklist\DataCheckLis t\DataCheckList\compare\")>
so everytime user can select which folder filename want to insert to database..

my coding is as below for copy file from folder to database :

<%
dim fs,fo,x
set fs=Server.CreateObject("Scripting.FileSystemObject ")
set fo=fs.GetFolder("C:\bey\datachecklist\DataCheckLis t\DataCheckList\compare\")
Dim objFSO, objTextFile
Dim sRead, sReadLine, sReadAll
Const ForReading = 1, ForWriting = 2, ForAppending = 8


    Dim Conn_str, rs, SQL
    Set Conn_Str = Server.CreateObject("ADODB.Connection")
    Conn_str.Open "Provider=SQLOLEDB;Data Source=stardocs-1foniw;UID=sa;PWD=sa;DATABASE=checklistsystem"
       'Print the name of all files in the test folder
      'Set objFSO = CreateObject("Scripting.FileSystemObject")
    'Set objTextFile = objFSO.CreateTextFile("C:\bey\datachecklist\DataCh eckList\DataCheckList\compare\try.txt", True)

for each x in fo.files


    'objTextFile.Writeline(x.Name)

      'Response.write(x.Name & "<br />")
  session("filename") = x.Name
  session("date") = date()
  Set rs = Server.CreateObject("ADODB.Recordset")
  SQL = "insert into try(filename,date) values('"&session("filename")&"','"&session("date" )&"')"
  set rs = conn_str.execute(sql)

     next
    set fo=nothing
    set fs=nothing








%>









Similar Threads
Thread Thread Starter Forum Replies Last Post
how to copy text in a word file on the clipboard donrafeal Word VBA 3 February 1st, 2007 12:32 AM
Copy text to win Clipboard irresistible007 Beginning VB 6 6 October 5th, 2006 06:04 AM
Howto save a Filename uploaded file to db? GigaBear ASP.NET 2.0 Basics 10 June 22nd, 2006 05:10 PM
How to copy text MICZ Pro VB 6 5 October 29th, 2004 09:57 AM
accessing an XML file with Filename in a var c# Jkelly BOOK: Professional Crystal Reports for VS.NET 0 August 16th, 2004 04:00 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.