Avatar of Ted Palmer
Ted Palmer
Flag for United States of America asked on

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

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
ProgrammingMicrosoft AccessR

Avatar of undefined
Last Comment
Jim Dettman (EE MVE)

8/22/2022 - Mon
Jim Dettman (EE MVE)

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

ASKER
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
Ted Palmer

ASKER
Jim,

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

Thank you for your help.

Ted
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Ted Palmer

ASKER
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
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...
ASKER CERTIFIED SOLUTION
Jim Dettman (EE MVE)

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Jim Dettman (EE MVE)

<<<<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.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Ted Palmer

ASKER
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
Ted Palmer

ASKER
Thank you. You  do great work.
Jim Dettman (EE MVE)

<<
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.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes