I cant give you afully working example, but heres a couple sniplets to help you along.
[tt]
Public Function LoadIntoCol(Optional Backup As Boolean = False) As Boolean [red] Dim fs As Object
Set fs = CreateObject("Scripting.FileSystemObject"
Dim Constants As Object
'Set Constants = CreateObject("Scripting.TextStream"
[/red]
...
If Not fs.FileExists(WebServer & SarasRoot & ConstantFile) Then
MsgBox "An error has occurred while reading from the web server. Make" & _
" sure that the path to the web server is correct and that the web has" & _
" been properly copied.", vbExclamation, "Error Occurred"
LoadIntoCol = False
Exit Function
End If [red] Set Constants = fs.OpenTextFile(WebServer & SarasRoot & ConstantFile)[/red]
CurrentRowNumber = 1
Do While Not Constants.AtEndOfStream
TextBuffer = Constants.ReadLine
EqualsLocation = InStr(1, TextBuffer, "="
If EqualsLocation > 0 Then
...
Else
...
End If
... [red] Constants.Close [/red]
End Function
[/tt]
and as for writing to the file (replacing it if it exist)
[tt]
Public Sub WriteCollection(ColType As Integer, Optional filename As String) [red]
Dim fs As Object
Set fs = CreateObject("Scripting.FileSystemObject"
Dim WriteColTxt As Object
[/red]
Dim row As New rows
If ColType = 1 Then [red] Set WriteColTxt = fs.OpenTextFile(WebServer & SarasRoot & IndexAsp, 2)[/red]
Else [red] Set WriteColTxt = fs.OpenTextFile(WebServer & SarasRoot & ConstantFile, 2)[/red]
End If
For Each row In WriteCol.rows
... [red] WriteColTxt.WriteLine row.Variable & "images\" & filename & row.Value [/red]
...
Next
[red]WriteColTxt.Close[/red]
End Sub
[/tt]
[sig]<p>Karl<br><a href=mailto:kb244@kb244.com>kb244@kb244.com</a><br><a href=
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.