Hi All,
I posted this in basic.visual.database the other day and got no response.
Hopiing someone here can help! Thanks!
I found an article entitled "Add a Touch of Web to Your Windows
Applications" on DevX.com and I'm trying to hone my skills. I've tried all 3
tutorials and have had success on all but the one that teaches databound
HTML on the fly. Everytime I execute my code, the WebBrowser control dies
and goes blank when it reaches the point of opening the recordset. I was
hoping you might help me out. Here is my VB6 code and my DB is an Access
2000 database connected via ODBC.
In General Declarations I have:
Dim db As Connection
Dim WithEvents Web1 As Recordset
In the Form_Load() I have...
WebBrowser1.Navigate2 "about:blank"
----------------------------------------------------------------------------
------------------------------------------------
Private Sub LoadWeb1()
Dim SQLWeb1 As String, TransTxt As String, BookTxt As String, Web1 As
Recordset
TransTxt = TranslationText.Text
BookTxt = BookText.Text
SQLWeb1 = "SELECT * FROM " & TransTxt & " WHERE Book = " & BookTxt & "
ORDER BY Chapter;"
Set Web1 = New Recordset
Web1.Open SQLWeb1, db, adOpenStatic, adLockReadOnly
Dim HTMLText As String
HTMLText = "<HTML><BODY BGCOLOR=#FFEEEE>"
Web1.MoveFirst
While Not Web1.EOF
HTMLText = HTMLText & "<FONT SIZE=4>" & Web1.Fields(BookNum).Value &
"</FONT>"
Web1.MoveNext
Wend
db.Close
HTMLText = HTMLText & "</BODY></HTML>"
WebBrowser1.Document.Script.Document.Clear
WebBrowser1.Document.Script.Document.Write HTMLText
WebBrowser1.Document.Script.Document.Close
End Sub
Thanks for any help!
Bill