is there nobody who can translate this injavascript? -
07-10-2004
, 04:08 AM
Hi,
I'm converting a big program from VB to Jscript. That prigram uses RDS
object.
In VB, the code is: (works)
<OBJECT CLASSID="clsid:BD96C556-65A3-11D0-983A-00C04FC29E33"
ID="OBJDC" WIDTH="1" HEIGHT="1">
<PARAM NAME="SERVER" VALUE="http://10.0.0.181">
</OBJECT
.....
objdc.handler="msdfmap.handler"
objdc.connect="Data source=res"
objDC.ExecuteOptions = adcExecSync
objDC.FetchOptions = adcFetchBackground
objdc.sql = "select logon, count(uur) as totuur from studres where
cdate(dag)> date() group by logon having logon='" & lo & "'"
objDC.Refresh
if objdc.recordset.recordcount > 0 then
totu = objdc.recordset("totuur")
end if
.....
Code in Jscript (doesn't
work):error=:"document.getElementById("OBJDC").Rec ordset has no properties"
.....
document.getElementById("OBJDC").handler="msdfmap. handler"
document.getElementById("OBJDC").connect="Data source=res"
document.getElementById("OBJDC").ExecuteOptions = 1
document.getElementById("OBJDC").FetchOptions = 2
document.getElementById("OBJDC").SQL = "select logon, count(uur) as totuur
from studres where cdate(dag)> date() group by logon having logon='" + lo +
"';"
document.getElementById("OBJDC").Refresh
if (document.getElementById("OBJDC").Recordset.Record Count > 0 )
{ totu = document.getElementById("OBJDC").Recordset("totuur ") }
.....
By the way, can i use in Jscript a shorter way like:
OBJDC.Recordset.RecordCount (like
in VB)?
Thanks
Bob |