dougthomas Moderator
Joined: 27 Jul 2005 Posts: 271 Location: Essex, UK
|
Posted: Mar 15th, 2006 01:11 AM Post subject: |
|
|
Hi,
A way to do this would be to:
(1) SELECT the information from the appropriate table
(2) Use the Replace function to substitute the result of the query into the html string
(3) Write the HTML string to a file
eg
| Code: |
Dim strHTML As String
Dim strHTML1 As String
Dim strSQL As String
Dim str34 As String
Dim strHobby As String
Dim intFile As Integer
str34 = Chr(34)
intFile = FreeFile
Open "c:\MyDir\MyFile.html" For Output As #intFile
strHTML = str34 & "AdvertisementFile=" & str34 & "XXXX.xml" & str34 & "></asp:adrotatorasasp:adrotator>" & str34
strSQL = "SELECT fldHobby FROM myTable WHERE fldUser = " & str34 & strName & str34
myRecordSet.Open strSQL, myConnection
If myRecordSet.Count <> 0 Then
strHobby = myRecordSet![fldHobby]
strHTML1 = Replace(strHTML, "XXXX", strHobby)
Print #intFile, strHTML1
Else
MsgBox "Hobby for" & strName & "Not Found"
End If
|
E&oE
Regards
Doug _________________ If you can see the light at the end of the tunnel, it probably means there's a Train coming. |
|