CreateObject in Agent Jscript not working

CreateObject in Agent Jscript not working

Post by Dennis O'Neil » Sat, 12 Feb 2000 04:00:00



I am using JScript in an Exchange Agent script to obtain an ADO connection
as follows

  dbConn = CreateObject("ADODB.Connection");

but I get an exception with error number /string

 getDBConn: -2146823281 Object expected

Anyone know how to create objects in an agent script using JScript?
dennis

 
 
 

CreateObject in Agent Jscript not working

Post by Dennis O'Neil » Sat, 12 Feb 2000 04:00:00


Duh.   Thanks!



> JScript doesn't have a CreateObject(... You must use:

> var newObject = new ActiveXObject("ADODB.Connection")

> MSDN does have a full JScript language reference. Search
> http://msdn.microsoft.com/library

> --
> Siegfried Weber

> Microsoft Most Valuable Professional (MVP) - Exchange Server
> Co-author of "Professional CDO Programming", Wrox Press 1999

> CDOLive - The Premier Resource for Microsoft Collaboration Data Objects
> http://www.cdolive.com

> Please reply to the newsgroups so that others can benefit from the
> discussion.
> Questions by e-mail are discarded without further notice - filter active.



> > I am using JScript in an Exchange Agent script to obtain an ADO
connection
> > as follows

> >   dbConn = CreateObject("ADODB.Connection");

> > but I get an exception with error number /string

> >  getDBConn: -2146823281 Object expected

> > Anyone know how to create objects in an agent script using JScript?
> > dennis


 
 
 

CreateObject in Agent Jscript not working

Post by Siegfried Weber [MVP Exchange » Sun, 13 Feb 2000 04:00:00


JScript doesn't have a CreateObject(... You must use:

var newObject = new ActiveXObject("ADODB.Connection")

MSDN does have a full JScript language reference. Search
http://msdn.microsoft.com/library

--
Siegfried Weber

Microsoft Most Valuable Professional (MVP) - Exchange Server
Co-author of "Professional CDO Programming", Wrox Press 1999

CDOLive - The Premier Resource for Microsoft Collaboration Data Objects
http://www.cdolive.com

Please reply to the newsgroups so that others can benefit from the
discussion.
Questions by e-mail are discarded without further notice - filter active.


Quote:> I am using JScript in an Exchange Agent script to obtain an ADO connection
> as follows

>   dbConn = CreateObject("ADODB.Connection");

> but I get an exception with error number /string

>  getDBConn: -2146823281 Object expected

> Anyone know how to create objects in an agent script using JScript?
> dennis