[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2017-03-17
10
Medium Priority
?
104 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
  • 5
  • 4
10 Comments
 
LVL 58
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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 19

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 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 2000 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 58
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 58
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

868 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