Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 383
  • Last Modified:

MFC with MS Access - Login data source dialog

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
nthnhung
Asked:
nthnhung
  • 2
1 Solution
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
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
 
nthnhungAuthor Commented:
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
 
nthnhungAuthor Commented:
Please close this question as my request if there is no objection from experts.
Thanks.
0
 
NetminderCommented:
Closed, 400 points refunded.
Netminder
Site Admin
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now