ivanc
asked on
VB 6 and DHTML
I am new to this but I am using VB 6 to program a dhtml. I can't understand why when I call
Response.write ("Hello World")
It generates and error indicating that object required...
Am I missing a library if so which one?
Tks in advance
Ivanc
Response.write ("Hello World")
It generates and error indicating that object required...
Am I missing a library if so which one?
Tks in advance
Ivanc
ASKER
Clockwatcher
When I use document.write it indicates I am using a function or method not supported VB.
Please help.
Tks
Ivanc
When I use document.write it indicates I am using a function or method not supported VB.
Please help.
Tks
Ivanc
ASKER
Clockwatcher
When I use document.write it indicates I am using a function or method not supported VB.
Please help.
Tks
Ivanc
When I use document.write it indicates I am using a function or method not supported VB.
Please help.
Tks
Ivanc
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ClockWatcher
I have checked up on MS and they have documented the above error as a bug in VB.
I have thus tried the method you have just tested but even more errors resulted
First
set ewioption = document.createelement("Op tion")
which was working fine gave me an error on Type mismatch
next
Even with the line of code of
Document.body.innertext = "Hello World"
It also resulted in Type mismatch error
Please advice
Ivanc
I have checked up on MS and they have documented the above error as a bug in VB.
I have thus tried the method you have just tested but even more errors resulted
First
set ewioption = document.createelement("Op
which was working fine gave me an error on Type mismatch
next
Even with the line of code of
Document.body.innertext = "Hello World"
It also resulted in Type mismatch error
Please advice
Ivanc
Perhaps it would help if you posted your full module.
ASKER
Private Sub DHTMLPage_Load()
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim EWIoption As IHTMLOptionElement
cn.open "Provider=Microsoft.Jet.OL EDB.4.0;Da ta
Source=\\yiscpuewi\darlee\ database\e wi.mdb;Per sist Security Info=False;Jet
OLEDB:Database Password=ewimj~33"
rs.open "select
Description,FileRef,File,R ev,Origina tor,Status ,Date,Appr ove,Ack1,A ck2,Approv
eA,Ack1A,Ack2A,Dept, Assy, Affect from EWI Order by Originator", cn
While rs.EOF = False
Document.Body.innerText = rs.Fields("file")
'Set EWIoption = Document.createElement("Op tion")
EWIoption.Text = rs.Fields("Description")
EWIoption.Value = rs.Fields("Description")
Select1.Options.Add EWIoption
rs.MoveNext
Wend
I am now able to print using the innertext function but I am still get a Type Mismatch error when creating the IHTMLelement
Tks
Ivanc
End Sub
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim EWIoption As IHTMLOptionElement
cn.open "Provider=Microsoft.Jet.OL
Source=\\yiscpuewi\darlee\
OLEDB:Database Password=ewimj~33"
rs.open "select
Description,FileRef,File,R
eA,Ack1A,Ack2A,Dept, Assy, Affect from EWI Order by Originator", cn
While rs.EOF = False
Document.Body.innerText = rs.Fields("file")
'Set EWIoption = Document.createElement("Op
EWIoption.Text = rs.Fields("Description")
EWIoption.Value = rs.Fields("Description")
Select1.Options.Add EWIoption
rs.MoveNext
Wend
I am now able to print using the innertext function but I am still get a Type Mismatch error when creating the IHTMLelement
Tks
Ivanc
End Sub
ASKER
Private Sub DHTMLPage_Load()
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim EWIoption As IHTMLOptionElement
cn.open "Provider=Microsoft.Jet.OL EDB.4.0;Da ta
Source=\\yiscpuewi\darlee\ database\e wi.mdb;Per sist Security Info=False;Jet
OLEDB:Database Password=ewimj~33"
rs.open "select
Description,FileRef,File,R ev,Origina tor,Status ,Date,Appr ove,Ack1,A ck2,Approv
eA,Ack1A,Ack2A,Dept, Assy, Affect from EWI Order by Originator", cn
While rs.EOF = False
Document.Body.innerText = rs.Fields("file")
'Set EWIoption = Document.createElement("Op tion")
EWIoption.Text = rs.Fields("Description")
EWIoption.Value = rs.Fields("Description")
Select1.Options.Add EWIoption
rs.MoveNext
Wend
I am now able to print using the innertext function but I am still get a Type Mismatch error when creating the IHTMLelement
Tks
Ivanc
End Sub
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim EWIoption As IHTMLOptionElement
cn.open "Provider=Microsoft.Jet.OL
Source=\\yiscpuewi\darlee\
OLEDB:Database Password=ewimj~33"
rs.open "select
Description,FileRef,File,R
eA,Ack1A,Ack2A,Dept, Assy, Affect from EWI Order by Originator", cn
While rs.EOF = False
Document.Body.innerText = rs.Fields("file")
'Set EWIoption = Document.createElement("Op
EWIoption.Text = rs.Fields("Description")
EWIoption.Value = rs.Fields("Description")
Select1.Options.Add EWIoption
rs.MoveNext
Wend
I am now able to print using the innertext function but I am still get a Type Mismatch error when creating the IHTMLelement
Tks
Ivanc
End Sub
ASKER
Private Sub DHTMLPage_Load()
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim EWIoption As IHTMLOptionElement
cn.open "Provider=Microsoft.Jet.OL EDB.4.0;Da ta
Source=\\yiscpuewi\darlee\ database\e wi.mdb;Per sist Security Info=False;Jet
OLEDB:Database Password=ewimj~33"
rs.open "select
Description,FileRef,File,R ev,Origina tor,Status ,Date,Appr ove,Ack1,A ck2,Approv
eA,Ack1A,Ack2A,Dept, Assy, Affect from EWI Order by Originator", cn
While rs.EOF = False
Document.Body.innerText = rs.Fields("file")
'Set EWIoption = Document.createElement("Op tion")
EWIoption.Text = rs.Fields("Description")
EWIoption.Value = rs.Fields("Description")
Select1.Options.Add EWIoption
rs.MoveNext
Wend
I am now able to print using the innertext function but I am still get a Type Mismatch error when creating the IHTMLelement
Tks
Ivanc
End Sub
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim EWIoption As IHTMLOptionElement
cn.open "Provider=Microsoft.Jet.OL
Source=\\yiscpuewi\darlee\
OLEDB:Database Password=ewimj~33"
rs.open "select
Description,FileRef,File,R
eA,Ack1A,Ack2A,Dept, Assy, Affect from EWI Order by Originator", cn
While rs.EOF = False
Document.Body.innerText = rs.Fields("file")
'Set EWIoption = Document.createElement("Op
EWIoption.Text = rs.Fields("Description")
EWIoption.Value = rs.Fields("Description")
Select1.Options.Add EWIoption
rs.MoveNext
Wend
I am now able to print using the innertext function but I am still get a Type Mismatch error when creating the IHTMLelement
Tks
Ivanc
End Sub
Okay, I think I have a better idea of what you're trying to do now. Setting the document.body.innerText effectively removes your select element. Instead of doing that, add a paragraph to your document. Call it paragraph1 and set its innerText property.
Here's the simplified code.
Private Sub DHTMLPage_Load()
Dim EWIoption As IHTMLOptionElement
Set EWIoption = Document.createElement("op tion")
paragraph1.innerText = "hello world"
EWIoption.Text = "mytext"
EWIoption.Value = "myvalue"
Select1.Options.Add EWIoption
End Sub
Here's the simplified code.
Private Sub DHTMLPage_Load()
Dim EWIoption As IHTMLOptionElement
Set EWIoption = Document.createElement("op
paragraph1.innerText = "hello world"
EWIoption.Text = "mytext"
EWIoption.Value = "myvalue"
Select1.Options.Add EWIoption
End Sub
ASKER
Private Sub DHTMLPage_Load()
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim EWIoption As IHTMLOptionElement
cn.open "Provider=Microsoft.Jet.OL EDB.4.0;Da ta
Source=\\yiscpuewi\darlee\ database\e wi.mdb;Per sist Security Info=False;Jet
OLEDB:Database Password=ewimj~33"
rs.open "select
Description,FileRef,File,R ev,Origina tor,Status ,Date,Appr ove,Ack1,A ck2,Approv
eA,Ack1A,Ack2A,Dept, Assy, Affect from EWI Order by Originator", cn
While rs.EOF = False
Document.Body.innerText = rs.Fields("file")
'Set EWIoption = Document.createElement("Op tion")
EWIoption.Text = rs.Fields("Description")
EWIoption.Value = rs.Fields("Description")
Select1.Options.Add EWIoption
rs.MoveNext
Wend
I am now able to print using the innertext function but I am still get a Type Mismatch error when creating the IHTMLelement
Tks
Ivanc
End Sub
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim EWIoption As IHTMLOptionElement
cn.open "Provider=Microsoft.Jet.OL
Source=\\yiscpuewi\darlee\
OLEDB:Database Password=ewimj~33"
rs.open "select
Description,FileRef,File,R
eA,Ack1A,Ack2A,Dept, Assy, Affect from EWI Order by Originator", cn
While rs.EOF = False
Document.Body.innerText = rs.Fields("file")
'Set EWIoption = Document.createElement("Op
EWIoption.Text = rs.Fields("Description")
EWIoption.Value = rs.Fields("Description")
Select1.Options.Add EWIoption
rs.MoveNext
Wend
I am now able to print using the innertext function but I am still get a Type Mismatch error when creating the IHTMLelement
Tks
Ivanc
End Sub
ASKER
Clockwatcher
I am sorry about the posting but how do I add a paragraph in the code?
TKs
Ivanc
I am sorry about the posting but how do I add a paragraph in the code?
TKs
Ivanc
You don't add a paragraph in the code, you add it in the designer-- the same place you added your select element.
Simply click within the document body (next to your select box) and press return. You'll add a paragraph element. Expand the document tree, click on the P element you created and give it the id 'paragraph1'
Simply click within the document body (next to your select box) and press return. You'll add a paragraph element. Expand the document tree, click on the P element you created and give it the id 'paragraph1'
ASKER
Clockwatcher
I have managed to get it working but I an trying to display the database and thus I am assuming I do not know how many records I have. Thus I would need to be able to add a new paragraph when a new record is being added.
I was wondering if a table would help the cause
I really appreciate your help thus far.
Ivanc
I have managed to get it working but I an trying to display the database and thus I am assuming I do not know how many records I have. Thus I would need to be able to add a new paragraph when a new record is being added.
I was wondering if a table would help the cause
I really appreciate your help thus far.
Ivanc
Client-side you'd be using:
document.write "Hello World"