Hi

Does anybody know how I can connect to a database from a script without
having to configure ODBC or install any software?
I plan to run the script on Windows 2000 Pro and Win XP machines.

Regards
Wayne

Re: Connect to DB by McKirahan

McKirahan
Tue Mar 15 08:43:25 CST 2005

"Wayne Gore" <WayneGore@discussions.microsoft.com> wrote in message
news:8AA7F7E8-C4D5-48AC-ADB9-B74404BE34C1@microsoft.com...
> Hi
>
> Does anybody know how I can connect to a database from a script without
> having to configure ODBC or install any software?
> I plan to run the script on Windows 2000 Pro and Win XP machines.
>
> Regards
> Wayne

Use a DSN-less connection.



Re: Connect to DB by WayneGore

WayneGore
Tue Mar 15 09:19:05 CST 2005

Ok...
How do I do that?

Regards
Wayne

"McKirahan" wrote:

> "Wayne Gore" <WayneGore@discussions.microsoft.com> wrote in message
> news:8AA7F7E8-C4D5-48AC-ADB9-B74404BE34C1@microsoft.com...
> > Hi
> >
> > Does anybody know how I can connect to a database from a script without
> > having to configure ODBC or install any software?
> > I plan to run the script on Windows 2000 Pro and Win XP machines.
> >
> > Regards
> > Wayne
>
> Use a DSN-less connection.
>
>
>

Re: Connect to DB by McKirahan

McKirahan
Tue Mar 15 09:39:55 CST 2005

"Wayne Gore" <WayneGore@discussions.microsoft.com> wrote in message
news:8617DBE3-B281-4ECF-9E2B-B1EF4E3F9573@microsoft.com...
> Ok...
> How do I do that?
>
> Regards
> Wayne

[snip]

Try a Google search.



Re: Connect to DB by MikeB

MikeB
Tue Mar 15 10:00:20 CST 2005


"Wayne Gore" <WayneGore@discussions.microsoft.com> wrote in message
news:8617DBE3-B281-4ECF-9E2B-B1EF4E3F9573@microsoft.com...
> Ok...
> How do I do that?

Start Here:
http://www.able-consulting.com/MDAC/ADO/Connection/ODBC_DSNLess.htm

There are others.

>
> Regards
> Wayne
>
> "McKirahan" wrote:
>
> > "Wayne Gore" <WayneGore@discussions.microsoft.com> wrote in message
> > news:8AA7F7E8-C4D5-48AC-ADB9-B74404BE34C1@microsoft.com...
> > > Hi
> > >
> > > Does anybody know how I can connect to a database from a script without
> > > having to configure ODBC or install any software?
> > > I plan to run the script on Windows 2000 Pro and Win XP machines.
> > >
> > > Regards
> > > Wayne
> >
> > Use a DSN-less connection.
> >
> >
> >



Re: Connect to DB by WayneGore

WayneGore
Wed Mar 16 08:11:02 CST 2005

Perfect.
Thanks for the tip Mike.

Cheers
Wayne

"MikeB" wrote:

>
> "Wayne Gore" <WayneGore@discussions.microsoft.com> wrote in message
> news:8617DBE3-B281-4ECF-9E2B-B1EF4E3F9573@microsoft.com...
> > Ok...
> > How do I do that?
>
> Start Here:
> http://www.able-consulting.com/MDAC/ADO/Connection/ODBC_DSNLess.htm
>
> There are others.
>
> >
> > Regards
> > Wayne
> >
> > "McKirahan" wrote:
> >
> > > "Wayne Gore" <WayneGore@discussions.microsoft.com> wrote in message
> > > news:8AA7F7E8-C4D5-48AC-ADB9-B74404BE34C1@microsoft.com...
> > > > Hi
> > > >
> > > > Does anybody know how I can connect to a database from a script without
> > > > having to configure ODBC or install any software?
> > > > I plan to run the script on Windows 2000 Pro and Win XP machines.
> > > >
> > > > Regards
> > > > Wayne
> > >
> > > Use a DSN-less connection.
> > >
> > >
> > >
>
>
>

Re: Connect to DB by WayneGore

WayneGore
Wed Mar 16 08:17:07 CST 2005

By the way...
On the homepage you recommend, the example for a DSN-Less connection to a
SQL server is:

oConn.Open "Driver={SQL Server};" & _
"Server=MyServerName;" & _
"Database=myDatabaseName;" & _
"Trusted_Connection=yes"

How do I create the obejct "oConn"?

Regards
Wayne

"MikeB" wrote:

>
> "Wayne Gore" <WayneGore@discussions.microsoft.com> wrote in message
> news:8617DBE3-B281-4ECF-9E2B-B1EF4E3F9573@microsoft.com...
> > Ok...
> > How do I do that?
>
> Start Here:
> http://www.able-consulting.com/MDAC/ADO/Connection/ODBC_DSNLess.htm
>
> There are others.
>
> >
> > Regards
> > Wayne
> >
> > "McKirahan" wrote:
> >
> > > "Wayne Gore" <WayneGore@discussions.microsoft.com> wrote in message
> > > news:8AA7F7E8-C4D5-48AC-ADB9-B74404BE34C1@microsoft.com...
> > > > Hi
> > > >
> > > > Does anybody know how I can connect to a database from a script without
> > > > having to configure ODBC or install any software?
> > > > I plan to run the script on Windows 2000 Pro and Win XP machines.
> > > >
> > > > Regards
> > > > Wayne
> > >
> > > Use a DSN-less connection.
> > >
> > >
> > >
>
>
>

Re: Connect to DB by McKirahan

McKirahan
Wed Mar 16 08:51:19 CST 2005

"Wayne Gore" <WayneGore@discussions.microsoft.com> wrote in message
news:5E565A39-D955-4B8D-B27B-B265ECE05005@microsoft.com...
> By the way...
> On the homepage you recommend, the example for a DSN-Less connection to a
> SQL server is:
>
> oConn.Open "Driver={SQL Server};" & _
> "Server=MyServerName;" & _
> "Database=myDatabaseName;" & _
> "Trusted_Connection=yes"
>
> How do I create the obejct "oConn"?
>
> Regards
> Wayne

[snip]

Set oConn = CreateObject("ADODB.Connection")

When you're through with it then destroy it via:

Set oConn = Nothing



Re: Connect to DB by Torgeir

Torgeir
Wed Mar 16 08:56:45 CST 2005

McKirahan wrote:

> "Wayne Gore" <WayneGore@discussions.microsoft.com> wrote in message
> news:5E565A39-D955-4B8D-B27B-B265ECE05005@microsoft.com...
>
>>By the way...
>>On the homepage you recommend, the example for a DSN-Less connection to a
>>SQL server is:
>>
>>oConn.Open "Driver={SQL Server};" & _
>> "Server=MyServerName;" & _
>> "Database=myDatabaseName;" & _
>> "Trusted_Connection=yes"
>>
>>How do I create the obejct "oConn"?
>>
>>Regards
>>Wayne
>
>
> [snip]
>
> Set oConn = CreateObject("ADODB.Connection")
>
> When you're through with it then destroy it via:
>
> Set oConn = Nothing
Hi

I think this one is better maybe:

oConn.Close




--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx

Re: Connect to DB by WayneGore

WayneGore
Wed Mar 16 08:59:01 CST 2005

Great.
Thanks.

Wayne

"McKirahan" wrote:

> "Wayne Gore" <WayneGore@discussions.microsoft.com> wrote in message
> news:5E565A39-D955-4B8D-B27B-B265ECE05005@microsoft.com...
> > By the way...
> > On the homepage you recommend, the example for a DSN-Less connection to a
> > SQL server is:
> >
> > oConn.Open "Driver={SQL Server};" & _
> > "Server=MyServerName;" & _
> > "Database=myDatabaseName;" & _
> > "Trusted_Connection=yes"
> >
> > How do I create the obejct "oConn"?
> >
> > Regards
> > Wayne
>
> [snip]
>
> Set oConn = CreateObject("ADODB.Connection")
>
> When you're through with it then destroy it via:
>
> Set oConn = Nothing
>
>
>