Posted by Dan Guzman on 11/28/06 02:14
The most common method used to access SQL Server from VBScript is ADO. An
OLEDB example:
Set connection = CreateObject("ADBDB.Connection")
connection.Open "Provider=SQLOLEDB" & _
";Data Source=MyServer" & _
";Initial Catalog=MyDatabase" & _
";Integrated Security=SSPI"
If you are using SQL 2005, you can use the SQL Native Client provider
(SQLNCLI).
--
Hope this helps.
Dan Guzman
SQL Server MVP
<akkha1234@gmail.com> wrote in message
news:1164676554.556065.232870@l39g2000cwd.googlegroups.com...
> Hi,
>
> I have written some batch scripts using osql to run some sql
> statements. They are basically something simple (such as running a
> stored procedure etc).
> I want to convert them to run using vbs. What kind of connection option
> do I have? I notice we can use DMO but I guess they are now phased out
> by Microsoft. Most of the example I see requires the setting up of
> ODBC. Is there a way of not using ODBC but direct connection (just like
> osql or isql)?
> Thanks for any hints or directions to some web sites.
>
Navigation:
[Reply to this message]
|