Forum Discussion

Ravik's avatar
Ravik
Super Contributor
9 years ago

TestComplete: Database connection error (SQL Server does not exist or access denied)

Hi All,

 

While trying to open connection for SQL Server, I am getting below error -

 

[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.

 

Normally I am able to connect and access database on my machine (same machine where is TC throwing error).

 

I have tried both ConnectionString as well as DSN.  (here I am using ADODB.connection & ADODB.Recortset)

 

 

(I did same with Oracle DB and it's work for me)

 

Is there any additional setting required for connect to SQLServer DB.

 

 

 

 

  • It is working now.

     

    The problem with ODBC32 & ODBC64 bit I have create DSN in ODBC32 and while execute query it's work but trying to execute same in TC it was showing error. Now I have create DSN in SysWOW64 and ran same code. it's work.

     

    In connection string part now I added below statement it is also work.

     

    ObjRecortset.CursorLocation = 3
    ObjRecortset.CursorType = 3
    ObjRecortset.LockType = 4

     

     

    Thanks All of you for your suggestions :)

     

     

     

    TestComplete can use only 32-bit database drivers to connect databases. It does not support 64-bit database drivers. This is due to the fact that TestComplete is a 32-bit application, so it cannot load 64-bit modules into its process. Thus, in order for TestComplete to be able to access a database running on a 64-bit client machine, 32-bit database drivers must be installed on the machine.

    If you use the Microsoft Open Database Connectivity Data Source Administrator tool to connect to a database on a 64-bit operating system, make sure that you use the 32-bit version of the tool, Odbcad32.exe (it is in the <Windows>\SysWOW64 folder). Otherwise, the tool will not be able to detect the needed 32-bit database drivers.