Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why tables are opened in default DS
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Why tables are opened in default DS
Miscellaneous
Thread ID:
00116263
Message ID:
00116263
Views:
61
VFP 5, Win95. I have a modeless invoicing form (private DS) that, before it release, instanciates another modeless form (InvoiceReport) with its own private DS. This is a form class I use for setting up and controlling a report form. However, the tables are being opened in the Default DS, and are left open after both forms are released. below is the code in the SetupTables method of the InvoiceReport form class. This form is never shown to the user. It just does its job and releases.
use Invoices order Invoice
lnInvoice = ThisForm.nInvoice
seek lnInvoice
ThisForm.lValidInvoice = !eof()
if eof()
   return
endif
use Customer order Cust_Num in 0
use Owner in 0
use Amco!TransType order TranType in 0
select Invoices
set relation to Cust_Num into Customer

* the next form property is set by the calling form and set to the
* calling forms datasession ID. The InvoiceItems table is a local
* view that is already populated with the invoice line items.
* This technique saves much time since a Requery of the massive
* LineItems table is not needed.
lnDSID = ThisForm.nDataSessionID
if type("lnDSID") <> "N" or lnDSID = 0
   use Amco!InvoiceItems alias ReportItems in 0
else
   use Amco!InvoiceItems alias ReportItems in 0 NoRequery lnDSID
endif
select Invoices
seek lnInvoice
lnCustNum = Invoices.Cust_Num
use Amco!CustomerInvoiceBalance in 0         && local view
use Amco!InvoicePostings in 0                && local view
use Amco!InvoiceBalance in 0                 && local view
select InvoicePostings
set relation to TransType into TransType
Other than actually printing or previewing the report (code in another method of this form class), there is no more code to this form class. There are no tables in the DE of the report either. The report uses the Default DS which I assumed would be the DS of the InvoiceReport form class. Which must be true because the report works great.

TIA.
Mark McCasland
Midlothian, TX USA
Next
Reply
Map
View

Click here to load this message in the networking platform