Solved

MFC with MS Access - Login data source dialog

Posted on 2006-07-03
5
373 Views
Last Modified: 2006-11-18
I'm working with a big software about security digital recorder base on camera images. We need to detect what object is in the current camera image. It's developed base on VC6, MFC. If the object is a car, we will increase a counter and write that value into MS Access database at the same time. In one second, the database writer can work more than 13 times. Now, there is a bug in my part but I don't know the reason. I let the software run through nights to test it. After about 2 days, at 12 PM, the software pops up a data souce login dialog. It looks like the following:

______________________________________________________________________
| Login                                                                                                                |
|_____________________________________________________________________|
|                                                                                                                         |
|   _Data Souce____________________________                    OK button                 |
|   |                                                                 |                                                  |
|   |_____________________________________|                   Cancel button            |
|                                                                                                                         |
|   _Authoriation____________________________                                                  |
|   |                                                                  |                 Database... button      |
|   |  Login name: (login name textbox)                |                                                 |
|   |  Password   : (password textbox)                  |                 Help button                |
|   |______________________________________|                                                 |
|                                                                                                                          |
|______________________________________________________________________|

I put TRY{}CATCH_ALL{} whenever connect, open and excute query and write to log file. When the dialog appears, there is nothing write out to log files. It means the exception can't be thown out from my software. I tested with MS access 2002 and 2003, it rarely happens on access 2003. I checked all my code and don't know the reason why. Whether some thing about MS Access regarding to this dialog box that I don't know? This dialog box appears putting the software in dangerous state. If end-user press Cancel button, the software can be crashed. It's really critical.
I hope that I will receive some solutions from all of you.
Thanks very much.
0
Comment
Question by:nthnhung
  • 2
5 Comments
 
LVL 84
Comment Utility
If the software is asking you to login again, I would suspect that would mean that you are losing your connection to the Access database. This could be a result of a network problem (is the database located on the same machine as the program), or something that's happening on the machine (like a scheduled task which tries to backup the db, which could cause your program to fail to communicate).

Any reason you're using a DSN instead of connecting directly with the DAO or ADO library? I admittedly don't know much about MFC or VC6, but typically you connect to a Access/Jet db via those methods instead of through a DSN.
0
 
LVL 1

Author Comment

by:nthnhung
Comment Utility
Thanks for your reply. I solved the problem. The connecting method is up to the base classes of my software, everything was in stable stucture. The problem comes from Synchronize time witih Internet time option of Windows.
I found the solution to omit that extra dialog from msdn page of Microsoft. In my case, I don't need that dialog, whenever the software can't find the database, it will create a new automatically.
0
 
LVL 1

Author Comment

by:nthnhung
Comment Utility
Please close this question as my request if there is no objection from experts.
Thanks.
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
Comment Utility
Closed, 400 points refunded.
Netminder
Site Admin
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now