View Single Post
  #10  
Old October 4th, 2009, 07:00 PM posted to microsoft.public.access.tablesdbdesign
fox
external usenet poster
 
Posts: 65
Default Split db and have backend on local PC

I'm uncertain what procedure you mean so I'll just try to explain how the
person gets the db

I have a Access DB My Jewelry Projects that I want to distribute to
individuals that want it....

So originally I had a backup and restore procedure however the code will not
run if the solution is packaged with access runtime so thus the reason for
the splitting of the db.

My thought is that if I split the db and package the front end in one
package and the backend in one package the uninstall of the front end to
install an upgrade will not affect the backend tables and the user will have
their data. So on upgrade only the front end would be upgraded....there are
problems with this but it's will have to do at the moment.

When I split the db of course it does not have a relative path so if I go
install it on another computer then the front end can not find the back end.

This means the the switchboard will not even open..no form is going to open.
The user does not have access to the navigation window for tables etc...

The procedure would be that the user would install the front end from the
exe file and then the backend from another exe file. Once installed it needs
to know where the back end is. Most users will not have too many computer
skills as well so things can not be too complicated...

Did I answer or am I just talking non sence...S
Thanks for your time I do appriciate it!


--
Foxy


"Klatuu" wrote:

The code for the GetUserID function should go in a standard module by itself.
But, do not name a module the same name as any function or sub in the
module. My module is named GetUserAPI

As to the Dir and MkDir part, it will depend on where you are trying to set
up the directory. If it is in a form, it might be in the Click event of a
command button.

Perhaps if you can describe the procedure, we can give you a better answer.
--
Dave Hargis, Microsoft Access MVP


"Fox" wrote:

Not so brite with the vb code so sorry if this sounds stupid...

Where would the If Dir statement go, in global code? autoexec?

--
Foxy


"Klatuu" wrote:

You can determine where the path should be:

If Dir("C:\Documents And Settings\" & GetUserID & "\My Jewlery Data\",
vbDirectory) = vbNullString Then

MkDir( "C:\Documents And Settings\" & GetUserID & "\My Jewlery Data")
End If

Here is the API call that will return the Windows user name of the user
currently logged in. Copy and Paste it into its own Standard Module.

Private Declare Function GetUserNameA Lib "Advapi32" (ByVal strN As String,
ByRef intN As Long) As Long
Public Function GetUserID()

Dim Buffer As String * 20
Dim Length As Long
Dim lngresult As Long, userid As String

Length = 20

lngresult = GetUserNameA(Buffer, Length)
If lngresult 0 Then
userid = Left(Buffer, Length - 1)
Else
userid = "xxxxxxx"
End If
GetUserID = UCase(userid)

End Function

--
Dave Hargis, Microsoft Access MVP


"Fox" wrote:

I will not know the user name folder....that's why I thought a relative path
would be \\My Documents\bla\bla.file
--
Foxy


"Klatuu" wrote:

It is not quite that simple. First, your syntax is incorrect using the
forward slash /

Also, you need to fully qualify the path. "My Documents" folder is a
subfolder of your user name folder. For example, my user name folder is
DaveH, so to get to My Documents, the full path is:

C:\Documents And Settings\DaveH\MyDocuments

Also, the path has to exist. If it does not, you can use MKDir to create
the path. To determine if it exists, use the Dir() function.

--
Dave Hargis, Microsoft Access MVP


"Fox" wrote:

I want to split my db for other reason than to share with tons of people and
I need the backend on the local machine with the front end but in a
different directory. The db front and backend will be
distributed as a packaged solution to a singler user. The user will install
the access runtime as well as the db's.
When I try to split the db called My Jewelry Project and place the backend
in a folder called My Jewelry Data using this address //My Document/My
Jewelry Data/JeweryData.accdb
it will not find the location....even though the folder exists....

I've tried ~/bla bla bla and ~//bla bla bla and these links do not work
either.

So how do I split a db and have the backend on the same computer with a
relative path?
Thanks,
--
Foxy