Accessing Database using VBScript in Outlook

I'm used to using the DAO object in Visual Basic programs to access database tables.  I'm trying to create an Outlook form which reads in database information using VBScript.  Is this possible?  If yes, how?
cwirrganAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

andcuCommented:
I think you must use ADO.  It's hardly any different from the actual coding point of view.  Similar properties/methods with similar names.
0
tkuppinenCommented:
If this is an internet application you could use ASP.   With ASP ADO is the inherent database access tool.
0
abwilesCommented:
result = GetJetConnection()
      if result <> 0 then exit function
 
      strSQL = "select * from Entities order by FundName"
      Set Entities = mydb.OpenRecordSet(strSQL,dbOpenSnapShot)
      do until Entities.EOF
            cmbJournalFunds.AddItem Entities("FundName")
            Entities.MoveNext
      loop

Function GetJetConnection

      on error resume next

      Dim strUser
      Dim strPass
      Dim dbDriverNoPrompt

      dbDriverNoPrompt = 1
      strUser = "sa"
      strPass = ""

      getJetConnection = 0

      Set dbe = Item.Application.CreateObject("DAO.dbEngine.35")
      if err.number <> 0 then
            msgbox err.description,16
            GetJetConnection = err.number
            exit function
      end if
      Set wrkJet = dbe.CreateWorkSpace("ODBCWorkSpace","admin","",dbUseJet)
      if err.number <> 0 then
            msgbox err.description, 16
            GetJetConnection = err.number
            exit function
      end if
      if not UseServer then
            Set mydb = wrkJet.OpenDatabase(DatabaseName,False)
      else
            ConnectStr = "uid=" & strUser & ";pwd=" & strPass & ";driver={SQL Server};Database=Marketing;server=" & ServerName
            Set mydb = wrkJet.OpenDatabase("",dbDriverNoPrompt,False,ConnectStr)
      end if

      if err.number <> 0 then
            msgbox err.description, 16
            GetJetConnection = err.number
            exit function
      end if

      DatabaseIsOpen = True

end function
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
cwirrganAuthor Commented:
Sorry about the delay, my home computer where I was working with Outlook died.  This answer got me going in the right direction.  Thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.