
app distribution w/ DB library reference
Hi Brent,
You can get the functions you mentioned working when you have a broken
reference but you have to use absolute references to them all the time,
until you know your references are ok.
So for example the following would probably fail
Dim strDBpath as string
strDBpath = Currentdb.Name
strDBPath = left(strDBPath,instr(strDBPath,Dir(strDBPath)) -1)
But something like this would work
Dim loDb as DAO.Database
Dim intInstr as Integer
Dim strDBPath as string
Dim strDBName as string
set lodb = Access.Currentdb
strDBPath = lodb.name
strDBname = VBA.DIR(strDBPath)
intInstr = VBA.Instr(strDBPath,strDBName)
strDBPath = VBA.Left(strDBPath,intinstr-1)
(The above written on the fly so probably not 100%)
As you can see all I've done is prefixed each function with the name of the
Library that the function is held in. You can get the Library names from
the Object Browser.
Quote:
>No, the reference does't have the same absolute path. I would prefer that
>the library DB be in the same path as the application and not require an
>absolute path for the application.
>One of the ideas I've been working with is to put the library DB in the
same
>path as the application DB and use the path of the CurrentDB.Name to update
>the reference for the library, therefore not requiring an absolute path.
>The problem seems to be that no string functions can be referenced
>(Mid,Left,Right) when ANY missing reference is detected. I need to remove
>the the file name from the CurrentDb.name and append the library database
>name to the path. I could then update the References Collection
>programatically before any library code is referenced.
>i.e. Application.References.AddFromFile <LibraryDbPath&File>
>If you have any more thoughts on the subject, I'd like to hear them.
>Thanks,
>Brent
>---------------------------------------------------
>Remove the 123 from email address
>This has been added to fight spam
>>Is the referenced database held in the same abolute path on your machine
>and
>>on the machine of the person you are sending the updates to?
>>>I've created an Access97 app which uses a library DB containing modules.
>>>Everytime I send an new update to be installed, the person installing the
>>>app has to refresh the reference to the library database. The application
>>is
>>>running under the full Access97 (not the runtime), so I have not been
>using
>>>the installer for distribution.
>>>Any Ideas?
>>>Thanks,
>>>Brent
>>>---------------------------------------------------
>>>Remove the 123 from email address
>>>This has been added to fight spam