Solved

MFC with MS Access - Login data source dialog

Posted on 2006-07-03
5
375 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
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Question about Relationship and Userform in Access Database 17 54
Modal form 11 30
Turn off MS Access Default=0 for Numerics 6 27
Reference Controls on subforms 7 28
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
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…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

809 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