Re: How to avoid hard-coded connect string in ActiveX VB Script Task?
From: Paul Smith (paulcutlast3_at_sagestore.com)
Date: 10/20/04
- Next message: Mingqing Cheng [MSFT]: "RE: DTS error copying tables"
- Previous message: Hari Prasad: "DTS Query"
- In reply to: Snake: "How to avoid hard-coded connect string in ActiveX VB Script Task?"
- Next in thread: Snake: "Re: How to avoid hard-coded connect string in ActiveX VB Script Ta"
- Reply: Snake: "Re: How to avoid hard-coded connect string in ActiveX VB Script Ta"
- Messages sorted by: [ date ] [ thread ]
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
- Next message: Mingqing Cheng [MSFT]: "RE: DTS error copying tables"
- Previous message: Hari Prasad: "DTS Query"
- In reply to: Snake: "How to avoid hard-coded connect string in ActiveX VB Script Task?"
- Next in thread: Snake: "Re: How to avoid hard-coded connect string in ActiveX VB Script Ta"
- Reply: Snake: "Re: How to avoid hard-coded connect string in ActiveX VB Script Ta"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|