Application path 
Author Message
 Application path

It is my understanding (I an ver new to this) that when a database name is
assigned to a data control, that usually 'locks in' the path.  Say you
define the databasename as "C:\VB5\VBDATA\MYDATA.MDB", and then create and
store your application in that subdirectory.  

What happens if you distribute your application and a user wants to install
it in say, "D:\USERAPPS\*.*".  Is there a way to handle this situation
ahead of time because you can never anticipate where a program might be
loaded?  How do you give the user flexibility to determine wher to load the
application?.  Does the application setup wizard address this?

-- Maurice I. Muoneke



Mon, 04 Sep 2000 03:00:00 GMT
 Application path

No it does not.  You need to put code on form open to change the property to

app.path & "\DATABASE.MDB"

-Clint LaFever



Mon, 04 Sep 2000 03:00:00 GMT
 Application path

Usually, it is best to set the application path at run time.  On the form
load event:  datcontrol.databasename = strPathName.  The first time the
application is started after installation, the user will be prompted to
point to the database files using a file dialog box.  The resulting path can
be stored in the registry or in a utility table.  This path should be tested
for validity each time the program runs.  If the data is moved, prompt for
the new path.  Designing a class to handle the functionality of this
procedures really speeds things up.

Hope this helps,
Darla

Quote:

>It is my understanding (I an ver new to this) that when a database name is
>assigned to a data control, that usually 'locks in' the path.  Say you
>define the databasename as "C:\VB5\VBDATA\MYDATA.MDB", and then create and
>store your application in that subdirectory.

>What happens if you distribute your application and a user wants to install
>it in say, "D:\USERAPPS\*.*".  Is there a way to handle this situation
>ahead of time because you can never anticipate where a program might be
>loaded?  How do you give the user flexibility to determine wher to load the
>application?.  Does the application setup wizard address this?

>-- Maurice I. Muoneke



Mon, 04 Sep 2000 03:00:00 GMT
 Application path

You can set the DataBaseName in code at runtime instead of in the properties
window at runtime.  A statement like:
        Data1.DataBaseName = App.Path & "mydb.mdb"
in the Form_Load event will attach the db to the data control as long as it's
in the same directory as the application.

Lee Weiner
weiner AT fuse DOT net


Quote:

>It is my understanding (I an ver new to this) that when a database name is
>assigned to a data control, that usually 'locks in' the path.  Say you
>define the databasename as "C:\VB5\VBDATA\MYDATA.MDB", and then create and
>store your application in that subdirectory.  

>What happens if you distribute your application and a user wants to install
>it in say, "D:\USERAPPS\*.*".  Is there a way to handle this situation
>ahead of time because you can never anticipate where a program might be
>loaded?  How do you give the user flexibility to determine wher to load the
>application?.  Does the application setup wizard address this?

>-- Maurice I. Muoneke

Lee Weiner
weiner AT fuse DOT net


Tue, 05 Sep 2000 03:00:00 GMT
 Application path

Here is what I have done.  I have defined the application path in the load
event.  Does this mean the user would be prompted to enter this path upon
startup after installation?  

Option Explicit
Dim dbCurrent As Database
Dim aSQL, bSQL, cSQL As String
Dim HoldPrim, HoldSec As Integer
Dim aRS, bRS, cRS As Recordset
Dim K0, L0, L1 As Integer

Private Sub datMaster_Click()
''''primary table navigation
Text1(0).Text = aRS.Fields(0).Value
Text1(1).Text = aRS.Fields(1).Value
Text1(2).Text = aRS.Fields(2).Value
Text1(3).Text = aRS.Fields(3).Value
Text1(4).Text = aRS.Fields(4).Value
Text1(5).Text = aRS.Fields(5).Value
Text1(6).Text = aRS.Fields(6).Value
Text1(7).Text = aRS.Fields(7).Value
With aRS
    .MoveNext
End With
End Sub

Private Sub datSecondary_Click()
''''secondary table navigation
Text2(0).Text = bRS.Fields(0).Value
Text2(1).Text = bRS.Fields(1).Value
Text2(2).Text = bRS.Fields(2).Value
Text2(3).Text = bRS.Fields(3).Value

With bRS
    .MoveNext
End With
End Sub

Private Sub datTertiary_Click()
'''''''''tertiary table navigation
Text3(0).Text = cRS.Fields(0).Value
Text3(1).Text = cRS.Fields(1).Value
Text3(2).Text = cRS.Fields(2).Value
With cRS
    .MoveNext
End With

End Sub

Private Sub Form_Load()
'''acquire data from master table

Set dbCurrent = OpenDatabase(App.Path + "\MULTITABLES.MDB")
aSQL = "select * from AGEPRIM"
Set aRS = dbCurrent.OpenRecordset(aSQL)
K0 = aRS.Fields(0).Value

Text1(0).Text = aRS.Fields(0).Value
Text1(1).Text = aRS.Fields(1).Value
Text1(2).Text = aRS.Fields(2).Value
Text1(3).Text = aRS.Fields(3).Value
Text1(4).Text = aRS.Fields(4).Value
Text1(5).Text = aRS.Fields(5).Value
Text1(6).Text = aRS.Fields(6).Value
Text1(7).Text = aRS.Fields(7).Value
'''''''''''''''''''''
''acquire data for secondary table'''''''''
bSQL = "select * from AGESEC WHERE PRIMKEY=" + Trim(Str(K0))
Set bRS = dbCurrent.OpenRecordset(bSQL)
L0 = bRS.Fields(0).Value
L1 = bRS.Fields(1).Value

Text2(0).Text = bRS.Fields(0).Value
Text2(1).Text = bRS.Fields(1).Value
Text2(2).Text = bRS.Fields(2).Value
Text2(3).Text = bRS.Fields(3).Value

''acquire data for tertiary table'''''''''
cSQL = "select * from AGETER WHERE PRIMKEY=" + Trim(Str(L0)) + "And
SECAUTO=" + Trim(Str(L1))
Set cRS = dbCurrent.OpenRecordset(cSQL)
Text3(0).Text = cRS.Fields(0).Value
Text3(1).Text = cRS.Fields(1).Value
Text3(2).Text = cRS.Fields(2).Value

End Sub



Quote:
> Usually, it is best to set the application path at run time.  On the form
> load event:  datcontrol.databasename = strPathName.  The first time the
> application is started after installation, the user will be prompted to
> point to the database files using a file dialog box.  The resulting path
can
> be stored in the registry or in a utility table.  This path should be
tested
> for validity each time the program runs.  If the data is moved, prompt
for
> the new path.  Designing a class to handle the functionality of this
> procedures really speeds things up.

> Hope this helps,
> Darla



Quote:
> >It is my understanding (I an ver new to this) that when a database name
is
> >assigned to a data control, that usually 'locks in' the path.  Say you
> >define the databasename as "C:\VB5\VBDATA\MYDATA.MDB", and then create
and
> >store your application in that subdirectory.

> >What happens if you distribute your application and a user wants to
install
> >it in say, "D:\USERAPPS\*.*".  Is there a way to handle this situation
> >ahead of time because you can never anticipate where a program might be
> >loaded?  How do you give the user flexibility to determine wher to load
the
> >application?.  Does the application setup wizard address this?

> >-- Maurice I. Muoneke



Tue, 05 Sep 2000 03:00:00 GMT
 Application path

The App object has a Path property that you can reference in your code that
will give you what you want.

Your database name would be App.Path & "\MYDATA.MDB"

This works as long as you place the database in the same directory is the
rest of your application.

Bryan Pollard



Quote:
> It is my understanding (I an ver new to this) that when a database name
is
> assigned to a data control, that usually 'locks in' the path.  Say you
> define the databasename as "C:\VB5\VBDATA\MYDATA.MDB", and then create
and
> store your application in that subdirectory.  

> What happens if you distribute your application and a user wants to
install
> it in say, "D:\USERAPPS\*.*".  Is there a way to handle this situation
> ahead of time because you can never anticipate where a program might be
> loaded?  How do you give the user flexibility to determine wher to load
the
> application?.  Does the application setup wizard address this?

> -- Maurice I. Muoneke



Sat, 09 Sep 2000 03:00:00 GMT
 
 [ 6 post ] 

 Relevant Pages 

1. Application Path question

2. Application Path

3. Application Path = ???

4. How to know executing application path? (not so trivial...)

5. UPGRADE PATH FOR FOXPRO 2.O APPLICATION

6. UPGRADE PATH FOR FOXPRO 2.O APPLICATION

7. Several paths for applications in Developer Server?

8. A local DDF path and a remote Data path does not work on SP3 (NT)

9. Paths and App.Path

10. Getting Long File Path from short Path / File Name

11. Replmerg uses UNC path despite explicit use of ftp path

12. app-path and mdb-path


 
Powered by phpBB® Forum Software