Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using .mdb (Access DB) file in QC
#2
Solved: 11 Years, 3 Months, 2 Weeks ago
Code:
Set objConnection = CreateObject("ADODB.Connection")
With objConnection
  .ConnectionString = "Driver={Microsoft Access Driver (*.mdb)};DBQ="&Trim(DbPath)&";Uid=;Pwd=;")
  .CommandTimeout = 60 'default is 30 secs
  .Open
End With

This might not be the right connection string, but you need to use the ADODB.Connection and ADODB.Recordset objects to connect and read data from the DB. You should be able to find plenty of examples on Google.
Oh, wait. I missunderstood the question.

You want to use the AccessDB instead of the Datatable? You can use the DB values in your script, but it will not duplicate the capabilities of the DataTable without you writing the code to do so. The datatable has some built in options like run all rows or single iteration. You can do that by using a DB recordset and a while/loop.

Sorry for misunderstanding.
Reply


Messages In This Thread
RE: Using .mdb (Access DB) file in QC - by jsknight1969 - 11-13-2009, 01:30 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  QTP script to save the generated .csv file and excel file priya elangovan 0 4,401 08-29-2012, 04:17 PM
Last Post: priya elangovan

Forum Jump:


Users browsing this thread: 2 Guest(s)