Article ID 2020 Article Title INFO: What is the difference between LogOnServer and NthTableLogOn? Article URL http://www.dataaccess.com/KBasePublic/KBPrint.asp?ArticleID=2020 KBase Category Crystal Reports Date Created 07/01/2004 Last Edit Date 07/01/2004
Article Text
QUESTION:
What is the difference between using LogOnServer and NthTableLogOn in a Visual DataFlex program that runs a Crystal Reports report?
ANSWER:
Besides the obvious reason of one setting up a connection in general -- for any table available on the server and database specified in the LogOnServer method -- and the other setting up a connection for that table only*, the way the connection is terminated is also different.
If you look into the CrystalReport.pkg you will see that those commands use two different methods from the CRPE32.dll (Crystal DLL):
External_Function32 PELogOnServer "PELogOnServer" CRPE32.DLL
External_Function32 PESetNthTableLogOnInfo "PESetNthTableLogOnInfo" CRPE32.DLL
In the Crystal help (Legacy.chm) you will find out that those two methods belong to different classes in Crystal (LogOnServer is from CRPEngine and NthTableLogOnxxxxx is from CRPEJob).
LogOnServer will connect you once and all the print jobs that follow will use that connection; the NthTableLogOnxxxxx is for the print job you are currently starting, i.e. when that print job is done, the connection is over.
In other words, to have the connection to the database for a user running a report terminated after the report is run, the application needs to use NthTableLogOnxxxxx methods, not LogOnServer.
* The propagate flag may be used to affect all tables with similar server and database properties.
Contributed By:
Americo Mauramatsu
Company: DAB
email: Suporte [suporte@dataaccess.com.br]
Links Related to this Article
DAW Knowledge Base article 1264: HOWTO: Run Crystal Reports report using DB2 / MSSQL database from VDF
Email this Article
Email this Article to a Colleague
Send Feedback on this Article to Data Access Worldwide
Copyright ©2024 Data Access Corporation. All rights reserved.
The information provided in the Data Access Technical Knowledge Base is provided "as is" without warranty of any kind. Data Access Corporation disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall Data Access Corporation or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if Data Access Corporation or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation may not apply.