Forum Discussion

Siax's avatar
Siax
Contributor
12 years ago

ADO Help

In the Documentation:

http://support.smartbear.com/viewarticle/28454/

it states that you can use :It can be used to execute only SQL queries (SELECT, UPDATE, INSERT, etc.),



But I can't find an example on how to update command and that's the SQL I would like to use on an Excel document.



I need help!

2 Replies

  • sastowe's avatar
    sastowe
    Super Contributor
    I have not had the TC wrappers for ADO work consistently well. If I were you, I would use CreateObject and address the ADO objects directly. Google ADO reference for details.
  • sbkeenan's avatar
    sbkeenan
    Frequent Contributor
    Hi Stuart



    I've just recently written a script that required a SQL Update to be executed.  My script is in VBScript and the database is MySQL.  I've included below a skeleton of my basic routine:





    sub sqlCommand()

        dim connection      'the ADO connection object.

        dim cmd                'the Command object.

         

        'set up the connection to the database.

        set connection = ADO.CreateConnection

        'specify your SQL database connection string.

        connection.ConnectionString = "<your connection string here>"

        connection.Open

        

        'create and specify the SQL command to execute.

        set cmd = ADO.CreateCommand

        cmd.ActiveConnection = connection

        cmd.CommandText = "<your SQL command here>"

        cmd.CommandType = adCmdText

        

        'execute the command.

        cmd.Execute()

    end sub






    Hopefully, this will work for you too!!



    Regards

    Stephen.