Developing directory independent

Developing directory independent

Post by Henk v.d. Ber » Tue, 08 Feb 2000 04:00:00



Being relatively new to VB (Win95, VB5) I am trying to set up a
generic routine to display a table, along with a param-query that
synchronizes with the key-field from the table. Here's the situation:

An MDB with:
- TableOne and TableMany
- QueryMany, set up as a param-query (Select Field2, Field3 from
TableMany where [TableOne.ForeignKey] = [TableMany.Key]

A form with:
- two DBGrids, DBGridOne and DBGridMany
- two data-controls, dtaOne and dtaMany

At startup the grids are filled from the data-controls, synchronizing
DBGridMany with DBGridOne.
I did manage to set this up with a hard-coded path to the MDB, but the
trouble starts when I read the directorypath from the registry.

First I set dtaOne.DatabaseName to point to the hard-coded dir, then
RecordSource to TableOne. The same for DBGridMany.
Then I remove the dtaOne.DatabaseName and read the databasename from
the registry. At that point I bumped into the fact that
dtaOne.RecordSource is available at design-time only (why this is done
baffles me anyway  :-).

Who can point me in the right direction with this problem?

Thanks in advance,

Henk

 
 
 

1. Developing directory independent [REPOST]

Being relatively new to VB (Win95, VB5) I am trying to set up a generic
routine to display a table, along with a param-query that synchronizes
with the key-field from the table. Here's the situation:

An MDB with:
 - TableOne and TableMany
 - QueryMany, set up as a param-query (Select Field2, Field3 from
TableMany where [TableOne.ForeignKey] = [TableMany.Key]

 A form with:
 - two DBGrids, DBGridOne and DBGridMany
 - two data-controls, dtaOne and dtaMany

At startup the grids are filled from the data-controls, synchronizing
DBGridMany with DBGridOne.
I did manage to set this up with a hard-coded path to the MDB, but the
trouble starts when I read the directorypath from the registry.

First I set dtaOne.DatabaseName to point to the hard-coded dir, then
RecordSource to TableOne. The same for DBGridMany.
Then I remove the dtaOne.DatabaseName and read the databasename from the
registry. At that point I bumped into the fact that dtaOne.RecordSource
is available at design-time only (why this is done baffles me anyway
:-).

Who can point me in the right direction with this problem?

Thanks in advance,

Henk

Sent via Deja.com http://www.deja.com/
Before you buy.

2. PostgreSQL and VLSI data?

3. Developing directory independent

4. Use 2 dbs in one SELECT

5. Developing Database Independent Applications

6. SQLMAINT and SET QUOTED_IDENTIFIER

7. Making the application directory-independent

8. dynamic range lookup (XREF?)

9. Developing directory independently

10. Set current directory as working directory

11. querying active directory using ms oledb provider for ms directory services

12. Oracle Internet Directory / Netscape Directory Server

13. Internet Directory and Active Directory referrals