VB6 Package+Deployment w/AccessDB 
Author Message
 VB6 Package+Deployment w/AccessDB

I am trying to do something which I'm sure is straight-forward, but I'm
completely missing the idea.  I'm new to VB6, and I want to Pack and Deploy
my shiny new VB6 Apps for distribution to multiple sites.  I'm using MS
Access 97/2000 database files to hold my data, and obviously need to include
these in the package.  However, I do not know how to make sure that when my
program gets to the user, the code will always be able to find the database.
When I create my data controls, I explicity declare the location of my
database(s), but I can see that if the user installs the program into a
directory which is not the same as mine, the program won't be able to
connect to the datasource.  I know I can force the setup program to install
into a pre-determined directory, but I don't think this is really the ideal
way of dealing with the problem.

Thanks in advance for your assistance

Carl Robinson



Sat, 17 Aug 2002 03:00:00 GMT  
 VB6 Package+Deployment w/AccessDB
My impression is that, if you leave off the explicit path of the database name
in your connection info, the VB application will "find" it in the current (i.e.
installation) directory.  I am attempting to do similar things as you.  How do
you insure that the JET database engine is included...
Quote:

> I am trying to do something which I'm sure is straight-forward, but I'm
> completely missing the idea.  I'm new to VB6, and I want to Pack and Deploy
> my shiny new VB6 Apps for distribution to multiple sites.  I'm using MS
> Access 97/2000 database files to hold my data, and obviously need to include
> these in the package.  However, I do not know how to make sure that when my
> program gets to the user, the code will always be able to find the database.
> When I create my data controls, I explicity declare the location of my
> database(s), but I can see that if the user installs the program into a
> directory which is not the same as mine, the program won't be able to
> connect to the datasource.  I know I can force the setup program to install
> into a pre-determined directory, but I don't think this is really the ideal
> way of dealing with the problem.

> Thanks in advance for your assistance

> Carl Robinson



Sat, 17 Aug 2002 03:00:00 GMT  
 VB6 Package+Deployment w/AccessDB
When you get to "package and deployment wizard - included files", click on
Add... and include your database file. The database will be copied to the
users c:\program files\your application\     directory. Make sure your
application looks for the database in that directory.

David Adam


Quote:
> I am trying to do something which I'm sure is straight-forward, but I'm
> completely missing the idea.  I'm new to VB6, and I want to Pack and
Deploy
> my shiny new VB6 Apps for distribution to multiple sites.  I'm using MS
> Access 97/2000 database files to hold my data, and obviously need to
include
> these in the package.  However, I do not know how to make sure that when
my
> program gets to the user, the code will always be able to find the
database.
> When I create my data controls, I explicity declare the location of my
> database(s), but I can see that if the user installs the program into a
> directory which is not the same as mine, the program won't be able to
> connect to the datasource.  I know I can force the setup program to
install
> into a pre-determined directory, but I don't think this is really the
ideal
> way of dealing with the problem.

> Thanks in advance for your assistance

> Carl Robinson



Sat, 17 Aug 2002 03:00:00 GMT  
 VB6 Package+Deployment w/AccessDB
When you get to "package and deployment wizard - included files", click on
Add... and include your database file. The database will be copied to the
users c:\program files\your application\     directory. Make sure your
application looks for the database in that directory.

David Adam


Quote:
> I am trying to do something which I'm sure is straight-forward, but I'm
> completely missing the idea.  I'm new to VB6, and I want to Pack and
Deploy
> my shiny new VB6 Apps for distribution to multiple sites.  I'm using MS
> Access 97/2000 database files to hold my data, and obviously need to
include
> these in the package.  However, I do not know how to make sure that when
my
> program gets to the user, the code will always be able to find the
database.
> When I create my data controls, I explicity declare the location of my
> database(s), but I can see that if the user installs the program into a
> directory which is not the same as mine, the program won't be able to
> connect to the datasource.  I know I can force the setup program to
install
> into a pre-determined directory, but I don't think this is really the
ideal
> way of dealing with the problem.

> Thanks in advance for your assistance

> Carl Robinson



Sat, 17 Aug 2002 03:00:00 GMT  
 VB6 Package+Deployment w/AccessDB
Change the directory from c:\application\database.mdb to
"$(AppPath)\database.mdb"

David Adam


Quote:
> I am trying to do something which I'm sure is straight-forward, but I'm
> completely missing the idea.  I'm new to VB6, and I want to Pack and
Deploy
> my shiny new VB6 Apps for distribution to multiple sites.  I'm using MS
> Access 97/2000 database files to hold my data, and obviously need to
include
> these in the package.  However, I do not know how to make sure that when
my
> program gets to the user, the code will always be able to find the
database.
> When I create my data controls, I explicity declare the location of my
> database(s), but I can see that if the user installs the program into a
> directory which is not the same as mine, the program won't be able to
> connect to the datasource.  I know I can force the setup program to
install
> into a pre-determined directory, but I don't think this is really the
ideal
> way of dealing with the problem.

> Thanks in advance for your assistance

> Carl Robinson



Sat, 17 Aug 2002 03:00:00 GMT  
 VB6 Package+Deployment w/AccessDB


Quote:
>I am trying to do something which I'm sure is straight-forward, but I'm
>completely missing the idea.  I'm new to VB6, and I want to Pack and Deploy
>my shiny new VB6 Apps for distribution to multiple sites.  I'm using MS
>Access 97/2000 database files to hold my data, and obviously need to
include
>these in the package.  However, I do not know how to make sure that when my
>program gets to the user, the code will always be able to find the
database.
>When I create my data controls, I explicity declare the location of my
>database(s), but I can see that if the user installs the program into a
>directory which is not the same as mine, the program won't be able to
>connect to the datasource.  I know I can force the setup program to install
>into a pre-determined directory, but I don't think this is really the ideal
>way of dealing with the problem.

>Thanks in advance for your assistance

>Carl Robinson

Instead of a quoting the exact path try:
 App.Path & "\putyourdatabasehere.mdb". This will look for the DB in the
same folder as the EXE file. If you locate the DB in a different
folder/domain then allow the user to find the path, and store it in the
registry.

Shaun



Sat, 17 Aug 2002 03:00:00 GMT  
 VB6 Package+Deployment w/AccessDB
Add the database file while running the Package and Deployment Wizard.
Define your database name as a global variable (if necessary) like
so...

Public strDATABASE_NAME as string

then point it to the database as follows..

strDATABASE_NAME = App.Path & "\YourDatabaseFileName.mdb"

The 'App.Path' will supply the complete path to your application's
installation directory, no matter where it gets installed on the
client machine.  Then, open the database as usual, using the
strDATABASE_NAME variable in place of the actual database filename.

This will also work for setting the data control's DatabaseName
property at runtime.  Simply set the property to the variable after
it's been initialized.

On Tue, 29 Feb 2000 14:08:53 -0000, "Carl Robinson"

Quote:

>I am trying to do something which I'm sure is straight-forward, but I'm
>completely missing the idea.  I'm new to VB6, and I want to Pack and Deploy
>my shiny new VB6 Apps for distribution to multiple sites.  I'm using MS
>Access 97/2000 database files to hold my data, and obviously need to include
>these in the package.  However, I do not know how to make sure that when my
>program gets to the user, the code will always be able to find the database.
>When I create my data controls, I explicity declare the location of my
>database(s), but I can see that if the user installs the program into a
>directory which is not the same as mine, the program won't be able to
>connect to the datasource.  I know I can force the setup program to install
>into a pre-determined directory, but I don't think this is really the ideal
>way of dealing with the problem.

>Thanks in advance for your assistance

>Carl Robinson



Sat, 17 Aug 2002 03:00:00 GMT  
 VB6 Package+Deployment w/AccessDB

Quote:

>Change the directory from c:\application\database.mdb to
>"$(AppPath)\database.mdb"

Can I do something similar if I'm using the DED i.e. how do I pass a
parameter/environment variable in the Database Name on the Connection tab
entry?
Tx!

--
To reply via e-mail *when solicited* and given *express permission* to do so,
please replace 'spamfree' with 'labyrinth'...



Sun, 18 Aug 2002 03:00:00 GMT  
 VB6 Package+Deployment w/AccessDB
Mike:

I honestly don't know exactly which files constitute JET, but I do know that
you can run the P&DW in a mode that only creates a dependency file.  Then
you can read that file and check to make sure all the needed files have been
included in your setup package.

Matt Gould


Quote:
> My impression is that, if you leave off the explicit path of the database
name
> in your connection info, the VB application will "find" it in the current
(i.e.
> installation) directory.  I am attempting to do similar things as you.
How do
> you insure that the JET database engine is included...


> > I am trying to do something which I'm sure is straight-forward, but I'm
> > completely missing the idea.  I'm new to VB6, and I want to Pack and
Deploy
> > my shiny new VB6 Apps for distribution to multiple sites.  I'm using MS
> > Access 97/2000 database files to hold my data, and obviously need to
include
> > these in the package.  However, I do not know how to make sure that when
my
> > program gets to the user, the code will always be able to find the
database.
> > When I create my data controls, I explicity declare the location of my
> > database(s), but I can see that if the user installs the program into a
> > directory which is not the same as mine, the program won't be able to
> > connect to the datasource.  I know I can force the setup program to
install
> > into a pre-determined directory, but I don't think this is really the
ideal
> > way of dealing with the problem.

> > Thanks in advance for your assistance

> > Carl Robinson



Mon, 19 Aug 2002 03:00:00 GMT  
 VB6 Package+Deployment w/AccessDB
Carl:

You might want to consider setting the location of your data for your data
controls programmatically and using a relative path.  The App.Path value is
a good place to start.  It is built into VB and returns the path to your
executable.  What this means, is that wherever your user installs your app
on his machine, App.Path will return that exact path.  This allows you to
place your data files either in the same directory or a relative directory
such as App.Path & "\Data\".  (Be careful to always check the value returned
by App.Path to ensure that the last character is a backslash, "\".)

It is true that you don't want your user to have to install to the exact
same path as the one on your development computer (e.g.,
"C:\MyVBApps\Test1\") because you can't know whether that path will exist.
However, there is nothing wrong with requiring the data to be placed into a
path relative to the executable.  You're going to have to install the data
files someplace, after all.

You might also want to consider setting up a DSN on the target computer that
points to your database wherever it is located.  Be warned, though, that
this by definition means you will be using ODBC.  I don't know how it is
with DAO (you never mentioned whether you were using DAO or ADO and I am
assuming you are using DAO), but with ADO I believe some functionality is
lost when using the OLE-DB Provider for ODBC against an Access database
rather than using the Jet Provider.

Matt Gould


Quote:
> I am trying to do something which I'm sure is straight-forward, but I'm
> completely missing the idea.  I'm new to VB6, and I want to Pack and
Deploy
> my shiny new VB6 Apps for distribution to multiple sites.  I'm using MS
> Access 97/2000 database files to hold my data, and obviously need to
include
> these in the package.  However, I do not know how to make sure that when
my
> program gets to the user, the code will always be able to find the
database.
> When I create my data controls, I explicity declare the location of my
> database(s), but I can see that if the user installs the program into a
> directory which is not the same as mine, the program won't be able to
> connect to the datasource.  I know I can force the setup program to
install
> into a pre-determined directory, but I don't think this is really the
ideal
> way of dealing with the problem.

> Thanks in advance for your assistance

> Carl Robinson



Mon, 19 Aug 2002 03:00:00 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. about the Package and Deployment Wizard (VB6)

2. VB6 and Package & Deployment Wizard

3. VB6:Using Package & Deployment Wizard

4. VB6 (SP5): Package and Deployment Wizard Dependency File

5. Package and Deployment VB6.0 Question

6. VB6 SP3 - Package and Deployment

7. VB6: Package/Deployment wizard bug?

8. VB6 Package and deployment wizard

9. vb6 package and deployment wizard problem

10. Package & Deployment Wizard Questions (VB6)

11. Problem in VB6 Package and Deployment Wizard

12. VB6 Package and Deployment Wizard

 

 
Powered by phpBB® Forum Software