Hi,

I wrote some vbscript last spring that queries the wsus 2.0 database
using sqloledb
and generates some csv files.

I'm not sure how to connect to the windows internal database for wsus
3.0 from vbscript using the SQLOLEDB provider. I think windows
internal db is really sql 2005 express embedded edition.

Here's some code that used to work, any advice on what would work for
connecting to sql 2005 express embedded edition?

Set objConnection = CreateObject("ADODB.Connection")
objConnection.ConnectionTimeout = 25
objConnection.Provider = "SQLOLEDB"
objConnection.Properties("Data Source").Value = strComputerName &
"\WSUS"
objConnection.Properties("Integrated Security").Value = "SSPI"

thanks,
Bruce

Re: vbscript adodb.connection to windows internal database by ekkehard

ekkehard
Sat Sep 08 01:55:24 PDT 2007

brucek schrieb:
> Hi,
>
> I wrote some vbscript last spring that queries the wsus 2.0 database
> using sqloledb
> and generates some csv files.
>
> I'm not sure how to connect to the windows internal database for wsus
> 3.0 from vbscript using the SQLOLEDB provider. I think windows
> internal db is really sql 2005 express embedded edition.
>
> Here's some code that used to work, any advice on what would work for
> connecting to sql 2005 express embedded edition?
>
> Set objConnection = CreateObject("ADODB.Connection")
> objConnection.ConnectionTimeout = 25
> objConnection.Provider = "SQLOLEDB"
> objConnection.Properties("Data Source").Value = strComputerName &
> "\WSUS"
> objConnection.Properties("Integrated Security").Value = "SSPI"
>
> thanks,
> Bruce
>
Maybe


http://projectdream.org/wordpress/2007/05/10/wsus-v3-and-connections-to-its-internal-database/


will help.

Re: vbscript adodb.connection to windows internal database by brucek

brucek
Sat Sep 08 02:05:30 PDT 2007

Hi, that worked fine from SQL Management Studio Express.

But I couldn't get it working from vbscript, here's what used to work
with MSDE:

Set objConnection = CreateObject("ADODB.Connection")
objConnection.ConnectionTimeout = 25
objConnection.Provider = "SQLOLEDB"
objConnection.Properties("Data Source").Value = strComputerName &
"\WSUS"
objConnection.Properties("Integrated Security").Value = "SSPI"

thanks,
Bruce



On Sep 8, 4:55 am, "ekkehard.horner" <ekkehard.hor...@arcor.de> wrote:
> brucek schrieb:
>
> > Hi,
>
> > I wrote some vbscript last spring that queries the wsus 2.0 database
> > using sqloledb
> > and generates some csv files.
>
> > I'm not sure how to connect to the windows internal database for wsus
> > 3.0 from vbscript using the SQLOLEDB provider. I think windows
> > internal db is really sql 2005 express embedded edition.
>
> > Here's some code that used to work, any advice on what would work for
> > connecting to sql 2005 express embedded edition?
>
> > Set objConnection = CreateObject("ADODB.Connection")
> > objConnection.ConnectionTimeout = 25
> > objConnection.Provider = "SQLOLEDB"
> > objConnection.Properties("Data Source").Value = strComputerName &
> > "\WSUS"
> > objConnection.Properties("Integrated Security").Value = "SSPI"
>
> > thanks,
> > Bruce
>
> Maybe
>
> http://projectdream.org/wordpress/2007/05/10/wsus-v3-and-connections-...
>
> will help.



Re: vbscript adodb.connection to windows internal database by Richard

Richard
Sat Sep 08 06:00:32 PDT 2007

Bruce wrote:

> I wrote some vbscript last spring that queries the wsus 2.0 database
> using sqloledb
> and generates some csv files.
>
> I'm not sure how to connect to the windows internal database for wsus
> 3.0 from vbscript using the SQLOLEDB provider. I think windows
> internal db is really sql 2005 express embedded edition.
>
> Here's some code that used to work, any advice on what would work for
> connecting to sql 2005 express embedded edition?
>
> Set objConnection = CreateObject("ADODB.Connection")
> objConnection.ConnectionTimeout = 25
> objConnection.Provider = "SQLOLEDB"
> objConnection.Properties("Data Source").Value = strComputerName &
> "\WSUS"
> objConnection.Properties("Integrated Security").Value = "SSPI"

Here is what I use to connect to an SQL Server database (2000 or 2005):
=============
' Connection string for SQL Server database.
strConnect = "DRIVER=SQL Server;" _
& "Trusted_Connection=Yes;" _
& "DATABASE=MyDatabaseName;" _
& "SERVER=MyServerName\MyInstance"

' Connect to database.
Set adoConnection = CreateObject("ADODB.Connection")
adoConnection.ConnectionString = strConnect
adoConnection.Open
===========
If you are using the default instance (rather than a named instance) omit
the backslash and instance name. It looks like the instance name in your
snippet is "WSUS"

--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
--