Re: How to avoid hard-coded connect string in ActiveX VB Script Task?

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Paul Smith (paulcutlast3_at_sagestore.com)
Date: 10/20/04


Date: Wed, 20 Oct 2004 07:34:52 +0100

You could have a ActiveX script that opens the UDL file (its unicode BTW)
and read the connection string line and use it in the .ConnectionString
property

Paul

"Snake" <Snake@discussions.microsoft.com> wrote in message
news:E740818B-2368-4451-A0EF-E104BE298AD7@microsoft.com...
>I have a load of VB script tasks that contain something like the following:
>
> '------------Connect and open pm table
>
> Set Cnn=CreateObject("ADODB.Connection")
> cnn.Provider = "sqloledb"
>
> Cnn.ConnectionString = "Provider=SQLOLEDB; Trusted_Connection=yes;
> Server=myserver; Database=mydatabase"
> Cnn.Open
> .
> .
> .
>
>
> We have a production server and a development server, and it is necessary
> to
> manually change the connection string code when moving scripts between
> servers. This does not always happen, causing production damage. Very
> Bad!
>
> I would like to be able to connect using a UDL identified by a global
> variable like in several other of our packages that do not use ActiveX
> Script
> Tasks. Is it possible? How do I do it?
>
> Thanks,
>
> Michael



Relevant Pages

  • Re: Database Access
    ... Why client script? ... the database server would not be possible from client machines. ... You will want the sqloledb connection string. ...
    (microsoft.public.scripting.jscript)
  • VB Scripting and XP Embedded
    ... What we are trying to do is connect to an sql database using a vb ... script that contains a simple con.open connection string. ... creating a DSN entry to the database, ...
    (microsoft.public.windowsxp.embedded)
  • Re: Link a db file directly to an existing db
    ... TransferDatabase command. ... path) and the table name in a connection string. ... situation in Access Help. ... Could you finish that script?. ...
    (microsoft.public.access.modulesdaovba)
  • Re: open password protected access database
    ... You could have the script prompt for the username and password, ... concatenate the values in the connection string. ... or batch file is just going to send the password to the ... not a username/password deal through an mdw file. ...
    (microsoft.public.scripting.vbscript)
  • Re: Multiple Workflow execution of Tasks
    ... You will have to use ActiveX script at some point. ... If the global variable is empty or has some initial value, the workflow ... I've create three SQL Tasks ...
    (microsoft.public.sqlserver.dts)