473,586 Members | 2,490 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ActiveX VBScript problem

Below is a code snippet that is throwing the following error:

Error Source: Microsoft DTS Package

Error Description: Error Code: 0
Error Source= Microsoft VBScript runtime error
Error Description: Object required: 'Server'

Error on line 13

In my code line 13 is the following:
Set Cnxn = Server.CreateOb ject("ADODB.con nection")

I did set up a Microsoft OLE DB connection in my DTS package for this
ActiveX Task. I'm new to VBScript and ActiveX. Any help would be
appreciated.

Thanks,

-p

'************** *************** *************** *************** ***********
' Visual Basic ActiveX Script
'************** *************** *************** *************** *************

Function Main()
Main = DTSTaskExecResu lt_Success

' connection, command and recordset variables
Dim Cnxn, strCnxn

' create and open connection
Set Cnxn = Server.CreateOb ject("ADODB.con nection")
strCnxn = "data source=Pluto;in itial catalog=Stats;U ser Id=sa;password= ;"
Cnxn.Open strCnxn

End Function

Jul 20 '05 #1
2 5373
The Server object is only available when running scripts under IIS. You
don't need it when running scripts via DTS or stand-alone. Try:

Set Cnxn = CreateObject("A DODB.Connection ")

--
Hope this helps.

Dan Guzman
SQL Server MVP

"Pippen" <12*@hotmail.co m> wrote in message
news:ESCWc.2230 77$eM2.87297@at tbi_s51...
Below is a code snippet that is throwing the following error:

Error Source: Microsoft DTS Package

Error Description: Error Code: 0
Error Source= Microsoft VBScript runtime error
Error Description: Object required: 'Server'

Error on line 13

In my code line 13 is the following:
Set Cnxn = Server.CreateOb ject("ADODB.con nection")

I did set up a Microsoft OLE DB connection in my DTS package for this
ActiveX Task. I'm new to VBScript and ActiveX. Any help would be
appreciated.

Thanks,

-p

'************** *************** *************** *************** ***********
' Visual Basic ActiveX Script
'************** *************** *************** *************** *************

Function Main()
Main = DTSTaskExecResu lt_Success

' connection, command and recordset variables
Dim Cnxn, strCnxn

' create and open connection
Set Cnxn = Server.CreateOb ject("ADODB.con nection")
strCnxn = "data source=Pluto;in itial catalog=Stats;U ser Id=sa;password= ;"
Cnxn.Open strCnxn

End Function

Jul 20 '05 #2

"Dan Guzman" <gu******@nospa m-online.sbcgloba l.net> wrote in message
news:NN******** *********@newss vr23.news.prodi gy.com...
The Server object is only available when running scripts under IIS. You
don't need it when running scripts via DTS or stand-alone. Try:

Set Cnxn = CreateObject("A DODB.Connection ")

--
Hope this helps.

Dan Guzman
SQL Server MVP

"Pippen" <12*@hotmail.co m> wrote in message
news:ESCWc.2230 77$eM2.87297@at tbi_s51...
Below is a code snippet that is throwing the following error:

Error Source: Microsoft DTS Package

Error Description: Error Code: 0
Error Source= Microsoft VBScript runtime error
Error Description: Object required: 'Server'

Error on line 13

In my code line 13 is the following:
Set Cnxn = Server.CreateOb ject("ADODB.con nection")

I did set up a Microsoft OLE DB connection in my DTS package for this
ActiveX Task. I'm new to VBScript and ActiveX. Any help would be
appreciated.

Thanks,

-p

'************** *************** *************** *************** ***********
' Visual Basic ActiveX Script
'************** *************** *************** *************** *************
Function Main()
Main = DTSTaskExecResu lt_Success

' connection, command and recordset variables
Dim Cnxn, strCnxn

' create and open connection
Set Cnxn = Server.CreateOb ject("ADODB.con nection")
strCnxn = "data source=Pluto;in itial catalog=Stats;U ser Id=sa;password= ;" Cnxn.Open strCnxn

End Function



That fixed it! Thanks for your help.

-p
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
5262
by: Tash Robinson | last post by:
Hi I am kind of new to active-x programming, and need a point in the right direction. I have an active-x control that I wrote in VB6. I wrote a testbed in VB and everything seems to work OK. I included the testbed and active-x in the same project so I can refrence the active-x in design time and when I run the testbed I can set...
7
2716
by: Newbie | last post by:
Hi all, I have some activeX code that I use to get the local computer name. (I don't think this is possible using ASP from my research). The rest of my code is ASP. I'd like to know how to pass the ActiveX variable into my ASP script. My code is as follows. Thanks. ----------------- activeX code: (I have this saved as activeX.asp...
7
2812
by: NewbieJon | last post by:
I am attempting to send the variable "sComputerName" from my ActiveX script to "GetInfo.asp" using javascript. (Having been advised this is the way to get my ActiveX variable into my ASP script) My code is below. I am getting the following error "MyForm.oNetwork.Value is Null or is not an object". I'm struggling to diagnose what to do next. ...
6
2582
by: Pippen | last post by:
I'm getting a little confused about what is supported in MS-SQL ActiveX and what is Visual Basic and what is VBScript. Can someone please point me to a website, recommend a book or if I've missed it where in the MS-SQL help that deals with the ActiveX supported in SQL. I'm not looking to do web pages ASP, ect. I'm looking to use the ActiveX as...
0
4398
by: ann | last post by:
Hi, I am trying to add an ActiveX control on my ASP.NET web form (the language for code behind is C#). I have some client-side vbscript to handle events from the html input buttons. In the client-side script, I am calling the ActiveX control object to perform some job. The problem is: when I run the application and click on the button...
6
9340
by: Steve Richter | last post by:
I am getting error in a vbscript: ActiveX component cant create object: Excel.Application. The vbscript code is: Dim objExcel Set objExcel = CreateObject("Excel.Application") I am pretty sure it is a permission issue because the script works when I point the browser directly at the .htm file on the c: drive:...
1
5158
by: Frank | last post by:
Short Version of Question: Can anyone provide an example of how I should embed the ActiveX and license, and then use it in a function?
0
1580
by: Frank | last post by:
Any suggestions on how I should handle this? I was asked to convert a small web application that was written in classic ASP into ASP.NET. The original site uses some VBScript to interface with an ActiveX control, which is contained in a CAB file. Somehow, I have managed to use the original VBScript in a respective .NET page, but there...
0
4259
by: rizzy | last post by:
Hello, didn't know where to post this, since you don't have a vbscript section. I thin k however that this applies to javascript as well. I have an asp.net web application which allows the staff to swipe a variety of cards as input. I have a magtek card reader (their tech support is incompetent) for that purpose. It requires an activex...
0
7915
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7841
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8204
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7965
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6617
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3838
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1184
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.