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
Solved

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

Posted on 2017-03-17
10
20 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 57
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
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
Jim,

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

Thank you for your help.

Ted
0
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.

 

Author Comment

by:Ted Palmer
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 15

Expert Comment

by:John Tsioumpris
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
<<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
<<<<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
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
Thank you. You  do great work.
0
 
LVL 57
<<
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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Join & Write a Comment

A short article about problems I had with the new location API and permissions in Marshmallow
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

791 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