Solved

MFC with MS Access - Login data source dialog

Posted on 2006-07-03
5
379 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 85
ID: 17036645
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
ID: 17040072
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
ID: 17047521
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
ID: 17076069
Closed, 400 points refunded.
Netminder
Site Admin
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

617 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