Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7623147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:38:04+00:00 2026-05-31T04:38:04+00:00

I am working on an update to an application that uses DAO to access

  • 0

I am working on an update to an application that uses DAO to access an SQL Server. I know, but let’s consider DAO a requirement for now.

The application runs all the time in the system tray and periodically performs SQL server operations. Since it is running all the time, and users of the application will be on laptops and transitioning between buildings, I’ve designed it to quietly transition between active and inactive states. When the database connection is successful operations resume.

I have one last issue before I release this update: When a connection is dropped, then reestablished, the SQL operations fail. This occurs only if I have specified the hostname in my connection string. If I use the IP, everything is fine (but I need to be able to use hostname).

Here is the behavior:

1) Everything working. Good network connection, database operations are fine.

2) Lost connection. Little ‘x’ appears on task bar icon, and nothing else. All ok.

3) Reconnect.

At step 3, I get an ‘ODBC–call failed’ error when I run the first query. Interestingly, the database is first opened without error.

If I skip step 1, and start the application when the connection is down, everything works fine in step 3, hostname or not.

I expect this is an issue with the DAO engine caching the DNS entry after the first connection, although the destination IP does not change so I’m not sure about that. I have tried flushing the windows DNS cache (from cmd prompt) to no effect. The same behavior occurs even when I’m using my local hostname with a local SQL server I set up for development. 127.0.0.1 has no problems.

I also tried to CoUninitialize() the DAO interface between active times, but I had trouble getting this to work. If someone thinks that would help I will work harder at it.

This behavior is the same in Windows XP or 7.

Thanks for anything you’ve got!

Edit: I should have mentioned – I am closing the database connection between the attempts, then reopening it with

m_pDb = m_pDaoEngine->OpenDatabase()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T04:38:06+00:00Added an answer on May 31, 2026 at 4:38 am

    I ended up biting the bullet and converting the application to ADO. Everything works nicely now, and database operations are much faster to boot.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a working web application that uses username/password SpringSecurity configuration. Now I want
I've got an MVC web application that uses SQL Server 2008 as a back
I've been working on an application that uses xVal's server side validation with data
I have a application im working on that uses the Jabber Libraries to connect
I am working to an application that uses jqGrid. The problem is that the
I am working on an application that uses EF 4.2 and database-first development, using
I'm currently working with a part of my application that uses Dynamic Web User
I am working on an application (.net 2.0) that uses mif/mid data format to
I'm currently working on an application that uses a view controller and a tabBar
I am working on a legacy jsp web application that uses JDBC and inline

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.