Ask a Question

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

SOLVED
Ravik
Super Contributor

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.

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Ravik
Super Contributor

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

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.

 

 

View solution in original post

5 REPLIES 5
Marsha_R
Community Hero

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

See if this helps:

 

https://community.smartbear.com/t5/Functional-Web-Testing/How-to-connect-SQL-Server-using-TestComple...


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
Ravik
Super Contributor

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

same issue 😞

Colin_McCrae
Community Hero

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

You sure your connection parameters are all correct?

 

I'm connecting to a local SQL DB no problem. Reads, updates, inserts ... all fine. Using ADODB + connection string.

 

Win 7 Pro 64 bit in a VM. SQL 2008 R2. TC 11.20.

 

All works just fine?

Ravik
Super Contributor

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

,

 

Thanks for update, as per my knowledge all are correct, let me check & confirm once again with "Dev Team" for connection string.

Meanwhile I have setup "Microsoft Access Database Engine 2010" it might help.

 

Thanks

 

Ravik
Super Contributor

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

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.

 

 

View solution in original post

cancel
Showing results for 
Search instead for 
Did you mean: