jasonhuibers
Programmer
I am able to successfully execute the following code as an excel macro. However I wanted to be able to run this code using vbscript. When I run this from my html page I encounter:
Microsoft VBScript runtime error '800a01ad'
ActiveX component can't create object: 'TDApiOle80.TDConnection'
on this line: Set tdc = CreateObject("TDApiOle80.TDConnection")
<BODY onload="vbscript:Call Hello()">
<SCRIPT language=VBScript>
sub Hello()
msgbox "Hello"
Set tdc = CreateObject("TDApiOle80.TDConnection")
tdc.InitConnectionEx " tdc.Login "admin", "Password"
tdc.Connect "Domain", "Project"
msgbox("Defect Raised")
'============================================
Set BugFactory = tdc.BugFactory
Set BugFilter = BugFactory.Filter
BugFilter.Filter("BG_BUG_ID") = DefectID
Set BugList = BugFilter.NewList
Set myBug = BugList.Item(1)
Set myBug = BugFactory.AddItem(Null)
'Enter values for required fields
myBug.Field("BG_STATUS") = "New" 'Status
myBug.Field("BG_Responsible") = "steveh" 'Assigned to
myBug.Field("BG_Priority") = "Minor"
myBug.Field("BG_User_12") = "ALL"
myBug.Field("BG_User_11") = "Access"
myBug.Field("BG_Subject") = "1"
myBug.Post
msgbox("Defect Raised")
end sub
Microsoft VBScript runtime error '800a01ad'
ActiveX component can't create object: 'TDApiOle80.TDConnection'
on this line: Set tdc = CreateObject("TDApiOle80.TDConnection")
<BODY onload="vbscript:Call Hello()">
<SCRIPT language=VBScript>
sub Hello()
msgbox "Hello"
Set tdc = CreateObject("TDApiOle80.TDConnection")
tdc.InitConnectionEx " tdc.Login "admin", "Password"
tdc.Connect "Domain", "Project"
msgbox("Defect Raised")
'============================================
Set BugFactory = tdc.BugFactory
Set BugFilter = BugFactory.Filter
BugFilter.Filter("BG_BUG_ID") = DefectID
Set BugList = BugFilter.NewList
Set myBug = BugList.Item(1)
Set myBug = BugFactory.AddItem(Null)
'Enter values for required fields
myBug.Field("BG_STATUS") = "New" 'Status
myBug.Field("BG_Responsible") = "steveh" 'Assigned to
myBug.Field("BG_Priority") = "Minor"
myBug.Field("BG_User_12") = "ALL"
myBug.Field("BG_User_11") = "Access"
myBug.Field("BG_Subject") = "1"
myBug.Post
msgbox("Defect Raised")
end sub