Hi

In my office there is an application ,and database is Sql server 2000.Using ODBC connection
application connect to database.Recently database move into sql server 2005.Now application is not working,Its generate error message error message is "Connection failed".I tested the ODBC connection its okay.

*I dont know what is language used for developed this application it ay be VB or VB.net.
*Initial database used is SQl server 2000


Please advice me to solve this issue

Thanks
Tank50

Dani AI

Generated

A compact troubleshooting note for this exact scenario (single EXE using a System DSN; DB moved from SQL Server 2000 to 2005; ODBC test OK but app reports “Connection failed”):

  1. DSN bitness first — 32-bit apps on 64-bit Windows only see DSNs created with the 32‑bit ODBC Administrator (C:\Windows\SysWOW64\odbcad32.exe). This is the most common cause when the ODBC admin “tests OK” but the app still fails.
  2. Instance/port resolution — SQL Server 2005 installations are often named instances that use dynamic ports. Confirm the DSN uses SERVERNAME\INSTANCE or an explicit IP:port, and that the SQL Browser service is running (or the port is fixed).
  3. Authentication and logins — as @adam_k hinted, confirm whether the app expects Windows Integrated Security or SQL logins. After a migration SQL logins can be missing or orphaned; verify the same credentials work from Management Studio.
  4. Driver choice — try the SQL Server Native Client driver for 2005 (SQLNCLI) rather than the very old “SQL Server” driver; some setups behave differently.
  5. Network/firewall and TCP/IP — verify TCP/IP is enabled in SQL Server Configuration Manager and firewall rules allow the server port (default 1433) and SQL Browser (UDP 1434) if needed.
  6. Tracing/logs — enable ODBC tracing and check the SQL Server error log and Windows Event Viewer for failed-login codes (e.g., 18456) to get the real error.

As suggested, creating a .udl file is a fast, no-code way to test outside the app: create a text file, rename to test.udl, double-click and use the dialog to test connection and copy a working connection string.

Example DSN‑less string (replace placeholders):

Driver={SQL Server Native Client 10.0};Server=SERVERNAME\INSTANCE,1433;Database=MyDB;Uid=myuser;Pwd=mypassword;

If the DSN works in the correct ODBC admin but the EXE still fails, the DSN bitness or an authentication/login mismatch is the most likely root cause.

Recommended Answers

All 5 Replies

Are you sure it's not using a connection string?
Have you changed the existing DSN or created a new one?

Hi

Thanks for reply adam.I think its not use connection string.beacuse there is only one exe file.so we put it to computers and created ODBC connection in compuer,then its works.

DSN?I never created DSN.How to do that?

Thanks

When you "create the ODBC", If you notice the tab names you are creating a DSN.

The real question about the DSN is did you use username and password when creating/testing the DSN or windows authentication?

HI

system DSN is created and but its not working still its give error message as odbc connection fail.

I put exe file into my local computer and I created system dsn then sql server dsn created for live server(SQL server 2000)

once I created the sql dsn for testing server(SQL 2005) then its give me error message(ODBC conncetion fail)

Thanks

create the udl file for the connection with database and use that connection string in your application

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.