0 Replies Latest reply on Apr 4, 2012 4:06 PM by BigGunN

    connect to database using vbscript

    BigGunN Level 1

      So i just got a monkey wrench thrown into the project I have been working on for the last month.  Originally it was supposed to be using an XML file. I finally finished it and got it delivered today. Now they want it to connect to an Access DB directly. 

       

      Reading through the forums, it seems like it is possible and is something that is alluded to, but I have searched and haven't found any examples of how to do it.

       

      This was my latest attempt, but it fails on the third line.

       

          Set MyConn = CreateObject("ADODB.Connection")

          MdbFilePath = "WebCatalogData.mdb"

          MyConn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=C:\Users\erich\DocumentsMdbFilePath;"

          SQL_query = "SELECT * FROM CatlogStories WHERE StoryID = 3"

          Set RS = MyConn.Execute(SQL_query)

          RS.Close

          set RS = nothing 

          MyConn.close

          set MyConn = nothing

       

      Does anyone have any example, or a point in a direction, of how to connect to an Access DB, using VBScript?

       

       

      Thanks.