Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Dynamic SQL Authentication

Author  Topic 

Rafferty Uy
Starting Member

23 Posts

Posted - 2004-11-25 : 22:42:19
Hello there!

I want to use an ActiveX Script Task object to dynamically set the username/password of the Server object which uses SQL authentication. How is this done? :)

I'm sorry for the very trivial/basic question. It's just that I don't know where to look these things up. Please advice :)

Thanks!

Rafferty

nreinholdt
Starting Member

8 Posts

Posted - 2004-11-27 : 22:19:49
I'd write something like this, bearing in mind that your SQL Server connection probably has the default name of "Microsoft OLE DB Provider for SQL Server".

dim oPkg
Set oPkg = DTSGlobalVariables.Parent ' easiest way to return a reference to the package object
oPkg.Connections("Microsoft OLE DB Provider for SQL Server").UserID = "BillGates"
oPkg.Connections("Microsoft OLE DB Provider for SQL Server").Password = "windowsupdate"

Good luck,
Niels

nragamuffin
Go to Top of Page

Rafferty Uy
Starting Member

23 Posts

Posted - 2004-12-09 : 20:23:06
I tried to do this but the "Use SQL Authentication" radio button in my Microsoft OLE DB Provider for SQL Server object wasn't selected when I executed the ActiveX Script Task, how do I do this?

-Rafferty
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2004-12-10 : 01:42:52
if server is mixed mode then it's ok, if it's only windows authentication, then you need to change the authentication mode.

edit: you can use sp_password to change the password.


--------------------
keeping it simple...
Go to Top of Page
   

- Advertisement -