Forum Discussion

googleid_108119's avatar
googleid_108119
Occasional Contributor
10 years ago

How will TestComplete script interface with MS access DB(32 bit app) in 64 bit OS?


Hi


 


I'm using TestExecute to run my test complete scripts at windows 2008 64 bit OS and facing issue while trying to interface with MS access DB.


 


Problem: It gives a vb script run time error: 'unspecified error' for code containing recordset opening of MS access DB. I picked up infected line of codes & tried testing the MS access DB connection seperately in DBconnection_chk..vbs file and found the error code : 8000405 "Data source name not found & no default driver specified"


 


Steps taken so far: I learnt that MS access is a 32 bit application and tried to run DBconnection_chk.vbs file with c:\windows\syswow64\cscript.exe It worked and connection established. 


 


Problem remains: The DB interface is a part of TestComplete script(.svb file) not the seperate code altogether in any vbs file. So I need to run the TestComplete script which is still giving same error. How would I configure TestExecute to run effectively in 64 bit OS while interfacing with MS access DB?


 


Please help.


 


Thanks


Sushil

6 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    Hi Sushil,



    You did not provide information on how exactly your code communicates with the Access, but in any case the problem is specified by the error text you've got.

    The case is TestComplete is 32-bit application and thus can communicate only with 32-bit database drivers/OLE DB providers. It is pretty probable that the 32-bit version of the driver that is consumed by the test code is absent on the 64-bit OS and thus you must install it.

    Also note, that if DSN (created using odbcad32 utility) is used to access your DB, than typing 'odbcad32' on the 64-bit OS will actually start 64-bit version of this utility which will create DSN in the 64-bit 'namespace'. In order to create a required DSN in the 32-bit 'namespace' you must call 'odbcad32' utility from the <Windows>\SysWOW64\ folder.
  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    Hi Sushil,



    > But same line of code gives unspecified error [...]

    Could you be more specific about what exact line errors out?



    > 32 bit driver is installed & above code runs fine in VBS file.

    If you are running vbs using command prompt started from <Windows>\System32 this means that you are running it in 64-bit environment. (To double check this start TaskManager and check the bitness of the cscript or wscript processes.)



    > DB_CONNECTION_STRING = "Driver={Microsoft Access Driver (*.mdb)};DBQ=D:\NIX Automation\Codebase\DB\DB.mdb;"

    This connection string makes me think that you are connecting to the Access via DNS, is this correct?

    If my guess is correct, then the DNS must be recreated in the 32-bit environment of your machine as well. In order to do this start odbcad32 utility from the <Windows>\SysWOW64\ folder.
  • googleid_108119's avatar
    googleid_108119
    Occasional Contributor
    Thanks Alex



    Even I feel the installaion of 32 bit DRIVEr is must. 



    But in other case how would I run/configure below LOC within testcomplete script file(.svb) from folder C:\Windows\SysWOW64\odbcad32.exe. It runs from vbs file. 




    Set objConnection  = CreateObject("ADODB.Connection")


    DB_CONNECTION_STRING = "Driver={Microsoft Access Driver (*.mdb)};DBQ=D:\NIX Automation\Codebase\DB\DB.mdb;"


    objConnection.Open DB_CONNECTION_STRING


    Set objCOMPRecSet = CreateObject("ADODB.RecordSet")


    objCOMPRecSet.Open "<QUERY>", objConnection

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    Hi Sushil,



    Assuming that the needed 32-bit driver is installed, the code looks good at the first glance.

    Does it errors out?
  • googleid_108119's avatar
    googleid_108119
    Occasional Contributor
    32 bit driver is installed & above code runs fine in VBS file. But same line of code gives unspecified error when run from testcomplete script file(.svb)



    How to resolve this issue? pl suggest