TestODBCConnection fails with SQL Server 2005 Express - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

elver
Posts: 29
Joined: Thu Oct 11, 2007 9:50 am

TestODBCConnection fails with SQL Server 2005 Express

Hi,

I successfully use the test odbc connection feature against a MSDE 2000 database, but the test fails when database is a SQL Server 2005 express.

Here is the SqlConnectionString:
Driver={SQL Server};Server=[BMS_DB_HOST]\OAMDB;Uid=sa;Pwd=sapw

Any idea?

Regards
Laurent
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

Can you please give more details about the problem you are encountering? Do you receive any errors when the test ODBC connection fails for SQL Server? If so, please mention the explicit error message from the ODBC driver.

Please note that the SQL Server 2005 Express uses different default settings than MSDE 2000 and you should make sure that you configured it correctly.

For example, in SQL Server 2005 Express:
- you are at no time prompted for the desired server name; this is set by the installer, and you are given absolutely no indication as to what it is
- in an automated install you don't get to set the 'sa' password, it's set to a random strong password by the installer

When installing SQL Server 2005 Express you can provide a command line for the installation package (by setting certain properties) in order to customize its settings.

For more details please consult the Microsoft Documentation for SQL Server 2005 Express installation. Also, you can visit this page:
http://www.aspfree.com/c/a/MS-SQL-Serve ... ss-2005/1/

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
elver
Posts: 29
Joined: Thu Oct 11, 2007 9:50 am

Well, my problem is not to install SQL Server 2005 Express, but to detect an already installed server instance while installing my own product. This detection using TestSqlConnection works fine if the installed server is a MSDE2000 one, but does not work with SQL Server 2005 Express, although the instance is running (I can connect through jdbc). I always obtain 0 as value of SqlConnectionOk variable.

The error message I get is:
SQLDriverConnect: [Microsoft][ODBC SQL Server Driver][DBNETLIB]This SQL server does not exist or the access is refused

I assume that it is a problem of driver. Using jdbc, I had to change the url, but using the TestSqlConnection of Advanced Installer, I don't know what could be the new values for the SqlConnectionString.

Regards
Laurent
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

Please note that the settings you used in JDBC should also be present in Advanced Installer. Can you please provide the URL that works with the JDBC so that we can advise you with the correct changes required by Advanced Installer?

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
elver
Posts: 29
Joined: Thu Oct 11, 2007 9:50 am

The URL is:

jdbc:jtds:sqlserver://127.0.0.1:1433/oamdb

Further, I connect using "sa" as user and "sapw" as password.

Regards
Laurent
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

Please note that you did not specify the database in the SqlConnectionString. You can try using a connection string similar to this one:

Code: Select all

Driver={[ODBC_RES_PROP]};Server=[SERVER_PROP];Port=[PORT_PROP];Database=[DATABASE_PROP];Uid=[USERNAME_PROP];Pwd=[PASSWORD_PROP];
Note that you will replace the above properties with the ones you use or you can specify the values directly.

In your case the resolved connection string should be:

Code: Select all

Driver={SQL Server};Server=(local);Port=1433;Database=oamdb;Uid=sa;Pwd=sapw;
Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
elver
Posts: 29
Joined: Thu Oct 11, 2007 9:50 am

Thanks for your advice. Unfortunately I still get 0 for SqlConnectionOk.
What do you recommend for the field [ODBC_RES_PROP]? I currently use the value "SQL Server", which was the value for MSDE2000.

Regards
Laurent
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

[ODBC_RES_PROP] will be replaced by the name of the ODBC driver, in this case SQL Server. However, for SQL Server 2005 you can try to use SQL Native Client instead of SQL Server.

Please note that if the SQL Server does not connect to the default instance then you will use Server=(local)\instance_name; (where you replace "instance_name" with the appropriate value) instead of Server=(local);

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
elver
Posts: 29
Joined: Thu Oct 11, 2007 9:50 am

Hi,

I finally succeded to test my connection to SQL Server 2005 Express using the following SqlConnectionString:

Driver={SQL Native Client};Server=[BMS_DB_HOST];Uid=sa;Pwd=sapw

Note that I don't specify any instance name! If I add one, the test fails...

Anyway, thank you very much for your support.

Regards
Laurent
aldebaran
Posts: 23
Joined: Wed Dec 05, 2007 4:04 pm
Location: Hannover, Germany
Contact: Website

Hi,

the problem with ODBC and SQLServerExpresss is related to the security settings in Express: the server does not answer on TCP/IP connections (default via ODBC) and can be connedted only via Shared Memory or Named Pipes.
The alternative is to use the SQL Native Client (as done).

Greetings
Stefan Hackenthal
aldebaran.de

Return to “Common Problems”