Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Testing access database
#1
Not Solved
Hello,

I am testing access database(.accdb extention) using qtp 11. When I spy on the table, it is not recognizing column by column. How can I select a specific column?

Please see the attached.

Thanks.

-S


Attached Files Image(s)
   
Reply
#2
Not Solved
Hi,

I did the below:


QTP software is installed in C drive.

I created a access database with accdb ext. Name of db is test.accdb. I saved it in H:\qtp

I created a dsn connection. Name is dsna.I added the test.accdb in the dsna connection. I gave password under advanced option.

In QTP, I wrote as:

Code:
myDSN="dsn=dsna;uid=hr;pwd=hr;"  
Set con= CreateObject("ADODB.Connection")  
Set rs = CreateObject("ADODB.Recordset")  

con.Open myDSN

I am getting error at the last line saying 'can not open data base.....'.

Any advise please.

Thanks.

-S
Reply
#3
Not Solved
HI S,

Try the this code.
Code:
Set oAccess= CreateObject("ADODB.Connection")
oAccess.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=H:\qtp\test.accdb"
If oAccess.State = 1 Then
    Msgbox "Pass"&vbcrlf&"Database Connection"&vbcrlf&"Database Connection is Open"
Else
   Msgbox "Fail" &vbcrlf&"Database Connection" &vbcrlf&"Database Connection is not Open"
End If
Thanks,
SUpputuri
Reply
#4
Not Solved
Hi,

When I access the DB, it only asks for password. So I added the password. I get error: could not find installable ISAM.

Please advise.

Code:
Set oAccess= CreateObject("ADODB.Connection")
oAccess.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=H:\qtp\test.accdb;pwd=df"
If oAccess.State = 1 Then
     Msgbox "Pass"&vbcrlf&"Database Connection"&vbcrlf&"Database Connection is Open"
Else
    Msgbox "Fail" &vbcrlf&"Database Connection" &vbcrlf&"Database Connection is not Open"
End If
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Issue in database testing excellentpawan 0 1,542 03-24-2015, 01:10 PM
Last Post: excellentpawan

Forum Jump:


Users browsing this thread: 1 Guest(s)