using vbs

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • akkha1234@gmail.com

    using vbs

    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.

  • Dan Guzman

    #2
    Re: using vbs

    The most common method used to access SQL Server from VBScript is ADO. An
    OLEDB example:

    Set connection = CreateObject("A DBDB.Connection ")
    connection.Open "Provider=SQLOL EDB" & _
    ";Data Source=MyServer " & _
    ";Initial Catalog=MyDatab ase" & _
    ";Integrate d 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@gmai l.comwrote in message
    news:1164676554 .556065.232870@ l39g2000cwd.goo glegroups.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.
    >

    Comment

    • Madhivanan

      #3
      Re: using vbs


      akkha1234@gmail .com wrote:
      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.
      All connection strings in one place. Find the syntax for your database connection using ADO.NET, ADO, ODBC, OLEDB, C#, VB, VB.NET, ASP.NET and more.


      Madhivanan

      Comment

      Working...