Visual Basic Customization

Reply
Contributor
tart5425
Posts: 15
Registered: ‎04-24-2003
Message 1 of 7 (216 Views)
Accepted Solution

The location of the Files Location Database must be the first item in...

216 Views, 6 Replies
09-23-2012 08:57 AM

I have AutoCAD 2012. When I try to run a program that requires Visual Basic, I'm getting a message that states the following:

"The location of the Files Location Database must be the first item in "\SentinelVBA" File Path in Preference Menu. It is advisable to correct before proceeding."

SentinelVBA is a folder which houses an Access database called "SentinelDB.mdb".

When I go to Preferences, Files, Support file Search Path, it reads "C:\Documents and Settings\Administrator\my documents\pacs\pacsacadcustom2005\sentinelvba". It is the first item in the list. When I change "sentinelvba" in that path to "SentinelVBA" (notice the caps) the program works properly, until I close AutoCAD and restart. Then the lower case letters are back and it does not work properly until I change it again.

Any help is greatly appreciated.

*Expert Elite*
Hallex
Posts: 1,569
Registered: ‎10-08-2008
Message 2 of 7 (202 Views)

Re: The location of the Files Location Database must be the first item in...

09-24-2012 02:24 AM in reply to: tart5425

My guess is to store database file name in your program

using Const directive like this:

Const mdbfile as String= "SentinelDB.mdb"

then i your sub routine you can load it directly

something like this:

 

Public MySub()

 

mdbfile = MyFolderName & "\" & mdbfile

 

End Sub

 

or without backslash if you've already added it to the folder path before

 

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
*Expert Elite*
Alfred.NESWADBA
Posts: 8,888
Registered: ‎06-29-2007
Message 3 of 7 (197 Views)

Re: The location of the Files Location Database must be the first item in...

09-24-2012 03:41 AM in reply to: tart5425

Hi,

 

>> Then the lower case letters are back and it does not work properly until I change it again.

Have you tried to rename the folder on your harddisk to lower characters?

 

>> The location of the Files Location Database must be the first item in "\SentinelVBA"

Is this a 3rd-party application for AutoCAD that's suggesting you to set this as first path? Or who told you that this is the rule for getting it to work?

 

- alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Contributor
tart5425
Posts: 15
Registered: ‎04-24-2003
Message 4 of 7 (183 Views)

Re: The location of the Files Location Database must be the first item in...

09-24-2012 06:37 PM in reply to: Alfred.NESWADBA

It doesn't seem to matter if the folder name is upper case, lower case or a combination. In Autocad 2012 I have to change the Support File Search Path in Options/Files to "C:\Documents and Settings\Administrator\my documents\pacs\pacsacadcustom2012\SentinelVBA" and not "sentinelvba". It doesn't matter if it's first or last in the Support File Search Path, so I don't know if the message "The location of the Files Location Database must be the first item in "\SentinelVBA" File Path in Preference Menu. It is advisable to correct before proceeding." is referring to that. By the way, that is a message that appears in Autocad.

This was some custom programming that someone did years ago. I don't know too much about how it works but I checked the cui in 2012 and it shows in the macro field "^C^C-vbarun main.MakeLegend". It seems to be running that macro in Visual Basic file "acad.dvb", which is in folder called "C:\Documents and Settings\Administrator\my documents\pacs\pacsacadcustom2005\SentinelVBA".

It works fine with Autocad 2007. The "Support File Search Path" will stay "SentinelVBA". But in 2012, it will always change back to lower case when it’s first opened, and it won't work until I change it.

*Expert Elite*
Alfred.NESWADBA
Posts: 8,888
Registered: ‎06-29-2007
Message 5 of 7 (177 Views)

Re: The location of the Files Location Database must be the first item in...

09-24-2012 10:15 PM in reply to: tart5425

Hi,

 

if you can modify the VBA-file then check where the errormessage comes from and verify there how it tries (and fails) to access the MDB-file. If it compares foldernames then try to convert the verification-syntax to convert the foldernames first to upper-case and then do the comparision.

 

Second question: are you running 2012 on a 64bit os or 32bit. If 64bit you may have some troubles accessing the MDB-file as of missing drivers for ODBC-MDB access (at least there is >>>one way<<<, but not sure if the guy in 2005 has programmed it in that way).

 

- alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
*Expert Elite*
dgorsman
Posts: 5,102
Registered: ‎10-12-2006
Message 6 of 7 (165 Views)

Re: The location of the Files Location Database must be the first item in...

09-25-2012 11:22 AM in reply to: tart5425

This sounds suspicously like the original programmer is doing a literal string comparison on the paths, without considering character case.  If the programmer isn't available, you might be able to hire somebody to check that other general updates/diagnostics.  If you don't have access to the source code... you're pretty much hosed.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
Adopt. Adapt. Overcome. Or be overcome.
A good question will be halfway to a good answer.


Contributor
tart5425
Posts: 15
Registered: ‎04-24-2003
Message 7 of 7 (149 Views)

Re: The location of the Files Location Database must be the first item in...

09-29-2012 02:09 PM in reply to: Alfred.NESWADBA

Haven't had time to do anything with this until now but, problem solved.

I searched the code and found this:

DBLocation = ParseFromList("SentinelVBA", preferences.Files.SupportPath, ";")

I changed SentinelVBA to sentinelvba and that did the trick.

Thanks Alfred.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community