Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Cannot Access The Table
I got two same database name which located in two directories:-
pAirAcctDataBase = pub_airacctdatapath + 'account.dbc'
pSeaAcctDataBase = pub_seaacctdatapath + 'account.dbc'
pAirPrg = pub_airacctprgpath + 'caloverdueamt_air'
pSeaPrg = pub_seaacctprgpath + 'caloverdueamt_sea'
Now, IN the form's cal_overcreditlimt method , there are some codes as follow:-
OPEN DATABASE &pSeaAcctDataBase
SET PATH TO &pub_seaacctdatapath
set database TO &pSeaAcctDataBase
SET PROCEDURE TO &pSeaPrg additive
pSeaDueAmt = CALOVERDUEAMt_sea(pCompanyCode,pDate)
CLOSE DATABASEs
OPEN DATABASE &pAirAcctDataBase
SET PATH TO &pub_airacctdatapath
set database TO &pAirAcctDataBase
SET PROCEDURE TO &pAirPrg additive
pAirDueAmt = CALOVERDUEAMt_air(pCompanyCode,pDate)
CLOSE DATABASEs
SELECT "InvoiceHeader" <-- Error
I can get the different value of pSeaDueAmt and pAirDuemAmt
However, as i 'close databases' it said 'Cannot access the selected Table'.
If i remove the 'CLOSE DATABASES' , i can get the SAME value of pSeaDueAmt and pAirDueAmt , but without the 'Error'.
I understand that As I 'Closes Database' ,it will close my current databases.
however, if i didn't close database,.. it seems the program cal the data from the same databases anme , it seems ignore my'set path'
Pls Help.
From Agnes
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement