Tuesday, March 27, 2012

ActiveX Vbscript still ok in Yukon ?

Will I still be able to use my current VBscripts (Active X) code in dts
packages in Yukon ?
Hi
In SQL Server 2005, there is an optional install of the SQL Server 2000 DTS
engine. this will allow the existing scripts to work (as long as you don't
use any T-SQL that is no longer supported in SQL Server 2005).
The new DTS engine in SQL Server 2005 is amazing and you will be very
tempted to convert your existing packages ASAP to the new engine.
Regards
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Rob C" <rwc1960@.bellsouth.net> wrote in message
news:I81xd.21621$rO2.720@.bignews1.bellsouth.net...
> Will I still be able to use my current VBscripts (Active X) code in dts
> packages in Yukon ?
>

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.CreateObject("ADODB.connection")

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 = DTSTaskExecResult_Success

' connection, command and recordset variables
Dim Cnxn, strCnxn

' create and open connection
Set Cnxn = Server.CreateObject("ADODB.connection")
strCnxn = "data source=Pluto;initial catalog=Stats;User Id=sa;password=;"
Cnxn.Open strCnxn

End FunctionThe 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("ADODB.Connection")

--
Hope this helps.

Dan Guzman
SQL Server MVP

"Pippen" <123@.hotmail.com> wrote in message
news:ESCWc.223077$eM2.87297@.attbi_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.CreateObject("ADODB.connection")
> 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 = DTSTaskExecResult_Success
> ' connection, command and recordset variables
> Dim Cnxn, strCnxn
> ' create and open connection
> Set Cnxn = Server.CreateObject("ADODB.connection")
> strCnxn = "data source=Pluto;initial catalog=Stats;User Id=sa;password=;"
> Cnxn.Open strCnxn
> End Function|||"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:NNGWc.4935$N04.1043@.newssvr23.news.prodigy.co m...
> 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("ADODB.Connection")
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Pippen" <123@.hotmail.com> wrote in message
> news:ESCWc.223077$eM2.87297@.attbi_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.CreateObject("ADODB.connection")
> > 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 = DTSTaskExecResult_Success
> > ' connection, command and recordset variables
> > Dim Cnxn, strCnxn
> > ' create and open connection
> > Set Cnxn = Server.CreateObject("ADODB.connection")
> > strCnxn = "data source=Pluto;initial catalog=Stats;User
Id=sa;password=;"
> > Cnxn.Open strCnxn
> > End Function

That fixed it! Thanks for your help.

-p

ActiveX VBScript DTS IsDate

Can someone explian why I get a return of not a valid date when using
activeX vbscript for DTS:
Select (Date())
Case (IsDate(Date())
msgbox "OK"
Case Else
msbox "I cant figure this out"
End Select
msbox "I cant figure this out" pops rather than msgbox "OK"Your Select Case statement is malformed. Try:
Select Case IsDate(Date())
Case True
MsgBox "OK"
Case Else
MsgBox "I cant figure this out"
End Select
Hope this helps.
Dan Guzman
SQL Server MVP
<lebeau777@.hotmail.com> wrote in message
news:1143836184.567616.6570@.z34g2000cwc.googlegroups.com...
> Can someone explian why I get a return of not a valid date when using
> activeX vbscript for DTS:
> Select (Date())
> Case (IsDate(Date())
> msgbox "OK"
> Case Else
> msbox "I cant figure this out"
> End Select
> msbox "I cant figure this out" pops rather than msgbox "OK"
>|||Please ignore my previous response (copy/paste error). The script should
be:
Select Case IsDate(Date())
Case True
msgbox "OK"
Case Else
msgbox "I cant figure this out"
End Select
Hope this helps.
Dan Guzman
SQL Server MVP
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:u45IViZVGHA.3716@.TK2MSFTNGP15.phx.gbl...
> Your Select Case statement is malformed. Try:
> Select Case IsDate(Date())
> Case True
> MsgBox "OK"
> Case Else
> MsgBox "I cant figure this out"
> End Select
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> <lebeau777@.hotmail.com> wrote in message
> news:1143836184.567616.6570@.z34g2000cwc.googlegroups.com...
>

Sunday, March 25, 2012

ActiveX transformations gone from SSIS?

In good old fashioned DTS there was the ability to perform custom transformations using activeX / vbscripty type language - does this still exist or are we stuck with the derived column editor?

I have never used DTS; but I know you can create Script tasks in the control flow and script components in the data flow.

Jamie Thomson has a series of post where he points some differences between DTS and SSIS:

http://blogs.conchango.com/jamiethomson/archive/2006/06/28/4156.aspx

|||

This does not still exist. You can either use the Derived Column transform or the Script Component transform.

One of the reasons this went away was the poor performance of using interpreted script. Another is that the built-in transforms in SSIS are so much more complete.

But the Derived Column transform could certainly use a better editor...

ActiveX to warm up Report Server ?

Because the IIS threads are recycled at night, the first user that calls up Report Manager in the morning has to wait 30 seconds before the page loads, as IIS is creating a thread.

I'd like to set up a job in SQL Agent that will navigate to http://localhost/reports/ every morning before users come in to work, so they won't have to wait.

I think a SAL Agent job of type ActiveX Script would be suitable for this, so I need to write the code to navigate to the reports page in VBScript.

Anyone knows how to navigate to a page in VBScript ?

tia.

I meant SQL Agent job, of course, not SAL.|||

Schedule a job with a simple plain empty record and schedule this before the needed time.

Jens K. Suessmeyer.

http://www.sqlserver2005.de

|||

I know how to schedule a job, but what is a "plain empty record" ? I have lots of RS subscriptions scheduled already and they don't affect the way the first user has to wait 30 secs for Report Manager to load up.

What I wanted to know was how to navigate to the report manager home page in VBScript. I couldn't find any example anywhere.

|||

This isnt a solution that you are looking for but maybe you dont need to reschedule the IIS worker process every night? My reportserver serves up about 800 reports per week and its hosted on a server which also hosts 9 other web applications.

I have set it in IIS that the worker process for report server does not recycle at all, and so far it hasnt recycled for 6 weeks. I occasionally manually recycle it and then go straight to the report server home page to start up the server quickly again.

Depends on your environment but maybe you dont need to recycle it every night.

sql

ActiveX to define presidence

I have a DTS package (SQL2000) which uses ActiveX scripts to check for records with certain criteria in a table. If the certain criteria is met, I want to initiate a child package that preforms a data-extraction. Otherwise move onto the next step which check for a different set of criteria. Currently if the criteria is met, I flag the task as success to dictate moving to one set of steps, otherwise failure & moving onto the next check.

The problem I am realizing, is that if I 'Fail' on of the check steps, subsequent steps furthur down the route that I am directing it to go, do not run. These are other ActiveX tasks that send email, and do furthur analysis.

Why is this the case? Can't you perform a logical check, and based upon the check have a decision to run certain steps? I attempted to use the result 'Main = DTSStepScriptResult_DontExecuteTask', but I must not be using it correctly, because it lists the task as returning failure.

Any help would be great.

Kevin Albrecht

DTS is called "SQL Server Integration Services" in the SQL Server 2005 generation. If you re-post your question in the SSIS forums (http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=80&SiteID=1) the DTS experts that hang out over there could likely answer your question.

Thanks,
Steve

|||Moving thread as per the suggestion to keep in SSIS related forums.|||Don't use success/fail as the flag to move to the next step. Set a variable and use an "Expression" precidence constraint to pick which one to move too.

ActiveX to copy and rename file

Hi,

I'm looking to use ActiveX in a DTS to copy a file from on elocation to another.
I have the code for this (attached below kindly supplied by a colleague), so that's cool.

dim filesys
set filesys=CreateObject("Scripting.FileSystemObject")

If filesys.FileExists("D:\Credits\Credits_MTD.mdb") Then
filesys.CopyFile "D:\Credits\Credits_MTD.mdb", _
"C:\Credits\Credits_200602.mdb"
End If

But what I'm looking to do is go one step further.
As you can see, it renames the file to yyyymm, but this is hard coded, and I'm looking for a coded solution so I can rename the file with yesterday's date.

Can anybody help me please?declare a variable path,get year,month,day-1 from system date,concatnate all and concatnate again with ur file path.
pass that variable.|||Cheers - sorry to be a apin but is it something like this:

dim newDate
newDate = FormatDateTime( Now()-1 , yyyymmdd )

....\Credits_" & NewDate & ".mdb"

I tried that, and it came back with Path Not Found|||Cheers - sorry to be a apin but is it something like this:

dim newDate
newDate = FormatDateTime( Now()-1 , yyyymmdd )

....\Credits_" & NewDate & ".mdb"



I tried that, and it came back with Path Not Found

Unforunatly I dont have vb platform to test it.

create the variable first and pass that variable.


dim path
path="C:\Credits\Credits_"&NewDate&".mdb"
filesys.CopyFile "D:\Credits\Credits_MTD.mdb", path|||Cheers,
Will try that now.