How to connect to an online MSSQL 2005 database

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for SQL Server in Delphi and C++Builder
Post Reply
DmitriNL
Posts: 15
Joined: Fri 26 Nov 2010 15:47

How to connect to an online MSSQL 2005 database

Post by DmitriNL » Fri 26 Nov 2010 18:57

I'm trying to connect to an online MSSQL database without any succes. On connecting the firewall is not throwing a question to connect. It seems the connection is not trying to connect to the internet.

I'm using C++ Builder XE, dbExpress (XE package), MSSQL Server 2005. MS SQL Server Management Studio can connect without any problems.

The error message after a 30 seconds is: Project Project1.exe raised exception class TDBXError with message 'SQL State: HYT00, SQL Error Code: 0 Login timeout expired. SQL State: 08001 SQL Error Code: 3. A netword-related or instance-specific error has occured while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance'.

The following parameters are set:

Code: Select all

SQLConnection1->ConnectionName = "MSSQLConnection";
SQLConnection1->DriverName = "MSSQL";
SQLConnection1->GetDriverFunc = "getSQLDriverMSSQL";
SQLConnection1->LibraryName = "dbxmss.dll";
SQLConnection1->VendorLib = "sqlncli10.dll";
SQLConnection1->LoadParamsOnConnect = true;
SQLConnection1->Params->Clear();
SQLConnection1->Params->Add("HostName=domain.net");
SQLConnection1->Params->Add("Database=***");
SQLConnection1->Params->Add("User_Name=***");
SQLConnection1->Params->Add("Password=***");
SQLConnection1->Params->Add("Port=1433");
SQLConnection1->Params->Add("BlobSize=-1");
SQLConnection1->Params->Add("ErrorResourceFile=");
SQLConnection1->Params->Add("LocaleCode=0000");
SQLConnection1->LoginPrompt = false;
The code for connection is:

Code: Select all

SimpleDataSet1->DataSet->CommandText = "SELECT * FROM pages";
SimpleDataSet1->Active = true;
SQLConnection1->Open();
I tried adding 'http://' to the 'HostName' parameter without any succes. Can someone please explain me how to connect to an online MSSQL database? Thank you in advance for your help.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Tue 30 Nov 2010 08:22

It seems that you use standard MSSQL driver. To use Devart SQL Server driver set the following properties:

Code: Select all

  SQLConnection1->ConnectionName = "Devart SQL Server"; 
  SQLConnection1->DriverName = "DevartSQLServer"; 
  SQLConnection1->GetDriverFunc = "getSQLDriverSQLServer"; 
  SQLConnection1->LibraryName = "dbexpsda40.dll"; 

DmitriNL
Posts: 15
Joined: Fri 26 Nov 2010 15:47

Post by DmitriNL » Tue 07 Dec 2010 07:48

I've tried your solutions but there is no file 'dbexpsda40.xxx' or 'dbexpsda*.xxx' on my computer. Im using dbExpress delivered with C++ Builder XE.

The problem is similar to: http://www.devart.com/forums/viewtopic.php?t=19600

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Tue 07 Dec 2010 13:56

This is a limitation of standard dbExpress driver for MS SQL Server.
You can buy DbxSda here: http://www.devart.com/dbx/sqlserver/ordering.html

DmitriNL
Posts: 15
Joined: Fri 26 Nov 2010 15:47

Post by DmitriNL » Thu 09 Dec 2010 08:52

I'm disappointed this is not a proper solution. :(

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 09 Dec 2010 11:13

Unfortunally, we don't support standard dbExpress drivers.

Post Reply