Click to See Complete Forum and Search --> : How Can I use CreateObject Method Html.


May 27th, 2000, 03:43 AM
Hi Anyone

How Can I use CreateObject Method in Html.
please let me know. Thanks !!

The following is a peice of code which I downloaded from MSDN Online (Banking Samples).
But it does'nt create the object of "BankSrv.CAdmin"


<html>
<head>
<title>Banking Navigation Page</title>
</head>
<body>
<script language="VBScript">
<--
Dim m_oAdmin
Dim m_iCurrBank
Dim m_iCurrAccount

Dim oBank
Dim iIndex
Dim bResult

on error resume next
'instantiate data services admin object
set m_oAdmin = CreateObject("BankSrv.CAdmin")
If Not m_oAdmin is nothing then
'initialize data services admin object
else
MsgBox("error instantiating BankSrv.CAdmin")
End If
-->
</script>
</body>
</html>

Spectre
May 27th, 2000, 10:33 PM
Try:

set m_oAdmin = Server.CreateObject("BankSrv.CAdmin")

Hope this helps.

Spectre

Lothar Haensler
May 29th, 2000, 02:11 AM
your code looks OK to me.
There can be several reasons why you couldn't create an ActiveX object. e.g.:
- the object isn't registered on your machine
- you do not have the permission to create AX objects (check IE's security settings).