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)
 CANT SEEM TO FIGURE OUT WHATS WRONG

Author  Topic 

dpais
Yak Posting Veteran

60 Posts

Posted - 2008-10-31 : 09:58:05
Hi -

I'm trying to lookup table DTS_parameter_table -
column PARAM1 for a value and stuff it into global parameter that i have setup in my dts.....

My global variable is called "part_num"

The activeX script needed to do this is below but i am getting an error

----------------------
Error Code :0
Error Source = Microsoft SQL - DMO (ODBC SQLState:28000)
Error Desc.[Microsoft][ODBC SQL Server Driver}{Sql Server}
Login failed for user 'sa'.
Reason: Not associated with a trusted SQL Server connection
Error on Line 9
----------------------

line 9 i believe is
oServer.Connect ".", "sa"

Questions i have is :
Suppose my pwd for account 'sa' is 'pwd001' then
what is the syntax to enter the pwd in the oserver.Connect line ??

Is there any other way i can easly pass a parameter to a DTS other than this method ??


Function main()
Dim oServer 'DMO Server object.
Dim oResult 'Result set.
Dim sParamValue

'Create a SQLDMO server object.
Set oServer = CreateObject("SQLDMO.SQLServer")

' Make a connection to the local server.
oServer.Connect ".", "sa"

'Select the desired row from the table.
set oResult =
oServer.Databases("vanguard").ExecuteWithResults_
("select param1 from DTS_Parameter_Table")

'Retrieve the first row, first column from the results.
sParamValue = oResult.GetColumnString (1,1)

'Set the global variable.
DTSGlobalVariables("part_num").Value = sParamValue

Main = DTSTaskExecResult_Success
End function


thanks for any help

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2008-10-31 : 10:37:47
See:

http://msdn.microsoft.com/en-us/magazine/cc301940.aspx

And when in doubt, refer to documentation.

- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page
   

- Advertisement -