Tuesday, March 27, 2012
ActiveX Vbscript still ok in Yukon ?
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
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
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 info
what is Visual Basic and what is VBScript. Can someone please point me to a
website, recommend a book or if I've missed it where in the MS-SQL help that
deals with the ActiveX supported in SQL. I'm not looking to do web pages
ASP, ect. I'm looking to use the ActiveX as add on funtionality to support
the Stored Procs I write.
Thanks,
-pPippen (123@.hotmail.com) writes:
> I'm getting a little confused about what is supported in MS-SQL ActiveX
> and what is Visual Basic and what is VBScript. Can someone please point
> me to a website, recommend a book or if I've missed it where in the
> MS-SQL help that deals with the ActiveX supported in SQL. I'm not
> looking to do web pages ASP, ect. I'm looking to use the ActiveX as add
> on funtionality to support the Stored Procs I write.
Personally I get confused only I see the term ActiveX. I think it is the
same as OLE, but I might be completely wrong.
Anyway, to call OLE objects from SQL Server you can use the sp_OAxxxx
routines, documented in Books Online.
Beware that if you call OLE objects that reside on the same machine as
SQL Server, they execute in-process, which means that an access violation
or similar execution error can cause the whole SQL Server to crash. While
this is useful at times, it something to use with caution.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||"Erland Sommarskog" <esquel@.sommarskog.se> wrote in message
news:Xns959C1FC09AB7Yazorman@.127.0.0.1...
> Pippen (123@.hotmail.com) writes:
>> I'm getting a little confused about what is supported in MS-SQL ActiveX
>> and what is Visual Basic and what is VBScript. Can someone please point
>> me to a website, recommend a book or if I've missed it where in the
>> MS-SQL help that deals with the ActiveX supported in SQL. I'm not
>> looking to do web pages ASP, ect. I'm looking to use the ActiveX as add
>> on funtionality to support the Stored Procs I write.
> Personally I get confused only I see the term ActiveX. I think it is the
> same as OLE, but I might be completely wrong.
> Anyway, to call OLE objects from SQL Server you can use the sp_OAxxxx
> routines, documented in Books Online.
> Beware that if you call OLE objects that reside on the same machine as
> SQL Server, they execute in-process, which means that an access violation
> or similar execution error can cause the whole SQL Server to crash. While
> this is useful at times, it something to use with caution.
>
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
> Books Online for SQL Server SP3 at
> http://www.microsoft.com/sql/techin.../2000/books.asp
After re-reading my post I did not make myself very clear... Please let me
try again. I'm looking to find resources to write ActiveX code to support my
stored procs ect... I'm confused on what the built in ActiveX compiler uses
out of the VBScript language. All of the VBScript books I pick up look like
they are written for web designers. I'm looking for a book or resource for
writing code for the ActiveX compiler in MS-SQL.
Sorry for the confusion,
-p|||Like a lot of Microsoft technology terms, ActiveX is a bit nebulous. Here's
a link to google definitions:
http://www.google.com/search?source...fine%3A+activex
The main concept is that ActiveX is a technology/API rather than a language.
One can write a script in a language like VBScript and then execute it using
SQL Server tools like a DTS ActiveX Script task, a SQL Server Agent ActiveX
Script job step or using the sp_OA* procs that Erland mentioned. The script
can also be run independently of SQL Server using Windows Scripting Host.
What functionality do you need to implement?
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Pippen" <123@.hotmail.com> wrote in message
news:ajUjd.483788$mD.296273@.attbi_s02...
> "Erland Sommarskog" <esquel@.sommarskog.se> wrote in message
> news:Xns959C1FC09AB7Yazorman@.127.0.0.1...
>> Pippen (123@.hotmail.com) writes:
>>> I'm getting a little confused about what is supported in MS-SQL ActiveX
>>> and what is Visual Basic and what is VBScript. Can someone please point
>>> me to a website, recommend a book or if I've missed it where in the
>>> MS-SQL help that deals with the ActiveX supported in SQL. I'm not
>>> looking to do web pages ASP, ect. I'm looking to use the ActiveX as add
>>> on funtionality to support the Stored Procs I write.
>>
>> Personally I get confused only I see the term ActiveX. I think it is the
>> same as OLE, but I might be completely wrong.
>>
>> Anyway, to call OLE objects from SQL Server you can use the sp_OAxxxx
>> routines, documented in Books Online.
>>
>> Beware that if you call OLE objects that reside on the same machine as
>> SQL Server, they execute in-process, which means that an access violation
>> or similar execution error can cause the whole SQL Server to crash. While
>> this is useful at times, it something to use with caution.
>>
>>
>> --
>> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
>>
>> Books Online for SQL Server SP3 at
>> http://www.microsoft.com/sql/techin.../2000/books.asp
> After re-reading my post I did not make myself very clear... Please let me
> try again. I'm looking to find resources to write ActiveX code to support
> my stored procs ect... I'm confused on what the built in ActiveX compiler
> uses out of the VBScript language. All of the VBScript books I pick up
> look like they are written for web designers. I'm looking for a book or
> resource for writing code for the ActiveX compiler in MS-SQL.
> Sorry for the confusion,
> -p|||Pippen (123@.hotmail.com) writes:
> After re-reading my post I did not make myself very clear... Please let
> me try again. I'm looking to find resources to write ActiveX code to
> support my stored procs ect... I'm confused on what the built in ActiveX
> compiler uses out of the VBScript language. All of the VBScript books I
> pick up look like they are written for web designers. I'm looking for a
> book or resource for writing code for the ActiveX compiler in MS-SQL.
Since, as Dan said, no one really knows what ActiveX (save, possibly,
for the marketers that invented the term), it may be easier if you told
us what your business problem is.
Now it sounds a bit like you are asking to access SQL Server from ActiveX.
In such I assume that you use the ActiveX Data Objects, that is ADO. David
Sceppa has a good book about ADO on Microsoft Press. It's a bit old, so I
don't know how easy it is to get hold of.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||"Erland Sommarskog" <esquel@.sommarskog.se> wrote in message
news:Xns959C688EF43EAYazorman@.127.0.0.1...
> Pippen (123@.hotmail.com) writes:
>> After re-reading my post I did not make myself very clear... Please let
>> me try again. I'm looking to find resources to write ActiveX code to
>> support my stored procs ect... I'm confused on what the built in ActiveX
>> compiler uses out of the VBScript language. All of the VBScript books I
>> pick up look like they are written for web designers. I'm looking for a
>> book or resource for writing code for the ActiveX compiler in MS-SQL.
> Since, as Dan said, no one really knows what ActiveX (save, possibly,
> for the marketers that invented the term), it may be easier if you told
> us what your business problem is.
> Now it sounds a bit like you are asking to access SQL Server from ActiveX.
> In such I assume that you use the ActiveX Data Objects, that is ADO. David
> Sceppa has a good book about ADO on Microsoft Press. It's a bit old, so I
> don't know how easy it is to get hold of.
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
> Books Online for SQL Server SP3 at
> http://www.microsoft.com/sql/techin.../2000/books.asp
After doing a little more research I think what I'm looking for is a book or
resource that deals with using VBScript in a DTS package to extend the
functionality of the DTS package; namely the ActiveX task in the DTS
package. Every book that I have picked up on VBScript deals primarliy with
webpages.
I have a process that needs to send and receive files that are encrypted
with PGP on a daily basis. Each of the files have unique names so I will
need to read tables to find the files that need to be processed. These files
will be encrypted / decrypted in the VBScript and loaded or extracted from
the DB. I would have used batch files (MS system) if not for the unique file
names. Essentially I'm looking to increase my knowledge of using VBScript in
an ActiveX task for this project and future projects.
Sorry about the misuse of normenclature, SQL is not my primary language.
Thanks,
-p|||Pippen (123@.hotmail.com) writes:
> After doing a little more research I think what I'm looking for is a
> book or resource that deals with using VBScript in a DTS package to
> extend the functionality of the DTS package; namely the ActiveX task in
> the DTS package. Every book that I have picked up on VBScript deals
> primarliy with webpages.
I know very little about DTS, and even less about books on DTS. However,
SQL Server MVPs Darren Green and Allen Mitchell runs www.sqldts.com, and
you might find some good tips there.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp