Hi, i have got a little problem, so i had to change a whole (working) form from vbscript to jscript.
Thing is, i wanted the form to show up in an email body as it looks like in infopath.
i found out, that using vbscript i can not accomplish that (when i add xDocument.DOM.xml to the email body it just looks like rubbish)
i also found out, that the stlye i need is easy to realize in jscript just as simple as:
var oEnvelope = XDocument.View.Window.MailEnvelope;
oEnvelope.To = "insertmailhere";
oEnvelope.Visible = true;
oEnvelope.Send = true;
it looks great in the emails.
so i had to create a new form, to make sure the language is jscript. but i have a problem to manage the database handlings i coded in vbscript.
i need to convert this:
Sub XDocument_OnLoad(eventObj)
set conn = CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "d:/folder/database.mdb"
set rs=CreateObject("ADODB.recordset")
set ts=CreateObject("ADODB.recordset")
rs.Open "select * from Personal", conn, 3, 3
dim temp, mail
do while not rs.EOF
if not isnull(rs.Fields("attributeA")) then
set temp = rs.Fields("attributeA")
ts.Open "select * from Personal", conn, 3, 3
do while not ts.EOF
if (ts.Fields("sname") = temp) then
rs.Fields("emailname").value = ts.Fields("emailname").value
if (master = "") then
master = (master + ts.Fields("emailname").value)
else master = (master + "; " + ts.Fields("emailname").value)
end if
end if
ts.Movenext
loop
ts.close
end if
rs.Movenext
loop
rs.Close
set rs = nothing
End Sub
into jscript
:(
don´t kill me if the code looks messy, i´m using vbscript for 1,5 weeks now, so it could be quite chaotic ^^
the code does this:
cycle through the db in search for the first object, that has an entry to attributeA
cycle again to find the entry where name = attributeA
set attributeA´s email-field to name´s email-entry
the "master" variable is not important, it´s just for the .To field
i have been quite glad to accomplish that within so little knowledge of the language, but now i need some help
so i would like to ask some questions on jscript:
how can i query the database for one special entry by cycling through the db (e.g. "search db for the entry, where name = dennis")
i think ...movenext or nextNode() doesn´t work
thanks
dennis