
February 26th, 2002, 11:25 PM
|
|
Contributing User
|
|
Join Date: Dec 2002
Posts: 14,575
  
Time spent in forums: < 1 sec
Reputation Power: 23
|
|
|
Originally posted by : Andres Melguizo Velez (lucan@bigfoot.com)Hi, this is just an example: Const ForReading = 1, ForWriting = 2, ForAppending = 8 szFileName = Server.MapPath("./") & "FileToRead.txt" Set fso = Server.CreateObject("Scripting.FileSystemObject") if (fso.FileExists(szFileName)) then Set txtFile = fso.OpenTextFile(szFileName, ForReading, False) szText = txtFile.ReadAll txtFile.Close Set txtFile = Nothing end if Set fso = Nothing ... all the text file contents is into szText variable.I hope this could be useful.I suggest you that you read the documentation FileSystemObject. If you use Norton Antivirus, be sure that ScriptBlocking is not enabled.Bye.------------Chris James at 2/8/2002 4:02:30 PMI am very new to asp and visual basic. All I need to do is read lines from a text file and plug them in as a variable untill the EOF. This should be very simple to do I know, but I am not sure how to get started. here is a sample of the code that I have.XXvar should be the variable.The text file is jsut line by line text ADOCommand.CommandText = ";(rdn=" + XXvar + "));uid,mail,cn;subtree" Set rs = ADOCommand.Execute Do While Not rs.EOF
|