Solved

Back-end Database connect string being set someplace where I can't find it.

Posted on 2017-03-17
10
50 Views
Last Modified: 2017-03-19
EE experts: I have inherited maintenance responsibility for a MS-Access 2003 application written by a boy wonder mathematics genius who has written some pretty exotic code from which I have learned some useful lessons. But . . . . Some of his code has some very serious amateur programming errors in technique. Like hard coding the connect string to a back-end database in every occurrence where it is needed. I have been maintaining this application for 8 years. I haven't worked on it in 4 years and seemed to have forgotten everything I knew about it and MS-Access 2003.

When I double click the Front-end.mdb file in Windows Explorer the application runs and presents the RUN-TIME_ERROR-3044 screen shown below. When I click the "Debug" button on the Run-Time dialog box window DOCMD.OPENFORM opens with a yellow arrow showing the line of code that threw the exception. This tells me that the exception occurred somewhere in the "Orders" form. But I can not find anywhere in the "Orders" form where the back-end database is being connected to using the connect string in RUN-TIME_ERROR-3044.

If I start the application with alt-F11, I can set a break point where the application is throwing the exception. When I single step using F-8 it doesn't tell me anything. Is there somewhere that I don't know of where this connect string parameter is being set that I don't know about?

I have a previous version of the same application in another MDB file that works just fine but I can't find any differences between the next version that I am trying to create using the MDB file that I copied to a flash drive from a working Workstation when I was last at the client's business and the last version that I have on my development PC.
Run-time_error-3044.JPG
DoCmd.OpenForm.JPG
0
Comment
Question by:Ted Palmer
[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
  • 5
  • 4
10 Comments
 
LVL 57
ID: 42053310
The connect path to a remote table is stored in a tabledefs connect property.

The simplest way to change that is using the linked table manager (Database tools).   Just select all the tables and point to the drive/directory where it resides.

But from your screen shot, it's currently set using the "H" drive.  So the other approach to get this running would be to map the path where the backend DB is to H

Jim.
0
 

Author Comment

by:Ted Palmer
ID: 42053397
Jim,

"H:" is a drive letter that is mapped on all workstations to a share on a production server. When I make maintenance changes to my client's software, I don't have a server to connect to. So therefore for all occurrences of this connect string I comment out the production connect string and substitute a different connect string: "Set dbsHWbe = DBEngine.OpenDatabase("C:\Drv1\Ted's_Stuff\HollowWoodworks\MS-Access_0518\HW_be.mdb", False, False, "")"

I  have commented out the production connect string for all occurrences in the application and substituted the above connect string which works in all previous versions of the application. But for some reason it's not working here?

This is the production connect string that I have commented out all occurrences in the entire application:

'Set dbsHWbe = DBEngine.OpenDatabase("H:\HW_be.mdb", False, False, "")

Ted
0
 

Author Comment

by:Ted Palmer
ID: 42053410
Jim,

I'll take a closer look at  linked table manager (Database tools).

Thank you for your help.

Ted
0
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 

Author Comment

by:Ted Palmer
ID: 42053431
Jim,

I was not able to find the  linked table manager. This system is very old by today's standards. I saw some references to registry entries and a suggestion to reinstall.

Ted
0
 
LVL 16

Expert Comment

by:John Tsioumpris
ID: 42053437
I think you should start with the basics...does your BE working properly(compact/repair)...can you link/import tables from the BE without connection strings...plain manually...
0
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
ID: 42053483
<<When I make maintenance changes to my client's software, I don't have a server to connect to. >>

 Right, but if you don't currently have an "H" drive mapped on the machine your working on, then simply create one.

 Put the BE in a folder, share that folder, then create a mapping for it.   You won't have to change any connect strings that way.

<<I was not able to find the  linked table manager.>>

 This is 2003?

Jim.
0
 
LVL 57
ID: 42053484
<<<<I was not able to find the  linked table manager.>>>>

  Tools, Database Utilities, Linked table manager in A2000/2003.

 This however will not change strings in code.  It will just change the .Connect property in the table definition.

 Jim.
0
 

Author Comment

by:Ted Palmer
ID: 42053606
Jim,

< <Put the BE in a folder, share that folder, then create a mapping for it.   You won't have to change any connect strings that way.>>

<<The simplest way to change that is using the linked table manager (Database tools).   Just select all the tables and point to the drive/directory where it resides.>>

I did the above and it worked just fine. All seems well. I also now know how to find my linked table manager. Now I have to go back and take out all the commented code for swapping out the connect strings. This has been a good learning experience for me.

I haven't worked on this guy's software for 4 years. It has also been 4 years since I have done anything in MS-Access. Obviously I have forgotten a lot over those 4 years.

Your help has made all the difference in the world for me when it comes to working on this guy's software. I am very embarrassed about not thinking of the "sharing" and "drive letter mapping" trick. Those are the kinds of things that I used to do almost instinctively.

Thank you,
Ted Palmer
0
 

Author Closing Comment

by:Ted Palmer
ID: 42053607
Thank you. You  do great work.
0
 
LVL 57
ID: 42054687
<<
I haven't worked on this guy's software for 4 years. It has also been 4 years since I have done anything in MS-Access. Obviously I have forgotten a lot over those 4 years.>>

 We all get rusty.   I'd hate to go back to VMS on a VAX right now<g>

 Glad to hear your set and of course you know where to come if you have questions<g>

Jim.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

726 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