Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using multiple databases within application
Message
From
15/02/2000 08:08:04
 
 
To
14/02/2000 13:55:38
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, United States
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00331825
Message ID:
00332105
Views:
15
>In my application, I am trying to allow the user to open any copy of the DBC they want and let them view those tables in the forms.
>
>For example, my DBC name is Acme.dbc and this dbc contains several tables. However, the user can create a new Acme.dbc and fresh copies of it's tables in other directories.
>
>How can I let my application know which Acme.dbc to open and also, when a form is opened, ensure that the tables from the desired Acme.dbc database are opened?
>
>Here is my directory structure:
>APPDIR\
> \Acme1\
> \Acme2\
> \Acme3\
>
>If a user chooses Acme.dbc from \Acme2\, I want only those tables to appear in the forms when the forms are called.
>
>Thanks

***********************
I use the next program before generates APP or Exe with all my forms
Note I use aDir() to know all my forms.

* Programa: BorraDirFormas (EraseDirForms)
* Escrito por: Carlos Fidel Restrepo Duperly
* Fecha: 24-Jun-99
* Abre una forma como tabla y elimina las referencias
* de directorio para poder trabajar con varios sets de
* datos sin problemas.
* Como parámetro se pasa el nombre de la forma

* It opens a form as table and deletes all directory references
* allowing working with different databases.
* The parameter is the form name

Procedure BorraDirFormas(cForma)

Close Tables All
Clear
* Elimina la terminación en caso de que sea pasada con el nombre de
* la forma
* Deletes extension if it exists.
cForma = JustStem(cForma)
Use (cForma+'.Scx')
* Sí el nombre de la forma tiene la palabra "contab",
* Se borra la información sobre el nombre de la base de datos
* Nota cada vez que se modifica la forma, esta información se regenera

* Busca por los registros que correspondan a "cursor"
Scan For BaseClass='cursor'
* Busca por "..\" y "\" y borra la información entre ellas
* Looks for "Database" And "\" and deletes with in them.
cPropiedad = Properties
nPos1 = At('..\',cPropiedad)
nPos2 =At('\',cPropiedad,2)

* Evita que cambie la fecha de los archivos de las formas sí esta información
* ya ha sido eliminada.
* When the database properties had been removed it doesn't change
* the form preserving the original form date

If nPos1 > 0
Replace Properties With;
Stuff(cPropiedad,nPos1, nPos2 - nPos1 + 1,'')
EndIf
EndSCan

Use

Return
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform