-
August 9th, 2002, 08:03 AM
#1
read a file????
i have a request SQL in a text file, and with the name of the file, i want to read the request, how can i proceed?
-
August 9th, 2002, 08:17 AM
#2
there are plenty of posts that cover this sort of thing so you can search the archives for something about this...hope it helps
- nc
"In a world without walls and barriers, what need is there for windows and gates!" - a mac ad
"What was the best thing before sliced bread and when did sliced bread go out of existence?" - me
"Software is like sex, it's better when it's free." - Linus Torvalds <- gotten from Andreas Masur
Live Penguine! - Tux the linux mascot
Vivez le penguine!, ¡Viva en penguine!, Lang lebe der Pinguin!, Viva no penguine!, Viva sul penguine!
-
August 9th, 2002, 08:20 AM
#3
There is other method (like with OPEN as RANDOM for READ 0, bu tthat one works well, it's with the FileSystemObject
Code:
'Add a reference to Microsoft Scripting Runtime
Dim fso As FileSystemObject
Set fso = New FileSystemObject
Dim objFile As File
'Get the file wanted
Set objFile = fso.GetFile("C:\boot.ini")
Dim objTextStream As TextStream
'Use the TextStream Object to retrieve text
Set objTextStream = objFile.OpenAsTextStream(ForReading)
'Read ALL the files
MsgBox objTextStream.ReadAll
'read a line
'objTextstream.ReadLine
'Destroy objects
Set objTextStream = Nothing
Set objFile = Nothing
Set fso = Nothing
JeffB - hope it helps
-
August 9th, 2002, 08:27 AM
#4
when i compile your code, i have this error:
non defined type for filesystemobject...
-
August 9th, 2002, 08:28 AM
#5
You have to add a reference to the microsoft runtime script.
Nicolas Bohemier
-
August 9th, 2002, 08:31 AM
#6
and how can i do that? ;-)
-
August 9th, 2002, 08:35 AM
#7
Guess you have French version, in VB6, go there:
Projects -> Références
Chose, in the list, Microsoft Scripting Runtime (coche la case)
If not there, try to find the file "scrrun.dll"
JeffB -hope it helps
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|