xsharp.eu • ReportPro (2) in ADS environment - Page 2
Page 2 of 2

Re: ReportPro (2) in ADS environment

Posted: Wed Apr 10, 2024 9:37 am
by ic2
Hello Chris,

I can see it everywhere, including on my development Pc which is switched off daily. Also it's clear that AD opens the DBF files. Like this:

Situation 1: ADS has not opened DBF files (because the program using ADFS & these files has not started). Then I can open these files with dbMax
Situation 2: ADS opened DBF files (because the program using ADFS & these files has started). Then I can NOT open these files with dbMax while ReportPro opens them with DBFCDX.

Question remains: why can ReportPro open dbf files in use from ADS with DBFCDX and dbMax can not?

Dick

Re: ReportPro (2) in ADS environment

Posted: Wed Apr 10, 2024 10:09 am
by FFF
Without any guarantees: I had a quick look, whether dbf header contains info about "locked" status. It seems, no. So, imho the filesystem handles this - and it might be, that ADS does not rely on this, but implements it's own way of locking, while cdx only looks for the answer, which windows gives.

Re: ReportPro (2) in ADS environment

Posted: Wed Apr 10, 2024 10:14 am
by Chris
Hi Dick,

Ah, just thought of it, they open fine from RP/any app that uses ADS, because the file opening is not really handled by RP, but by ADS itself. RP only tells ADS to open the files and ADS (which has already opened them itself) does the rest.

Edit: Basically, what Karl said just before me :)

Re: ReportPro (2) in ADS environment

Posted: Thu Apr 11, 2024 2:31 pm
by ic2
Hello Karl, Chris,

Thanks for your replies. So ReportPro has a mechanism that hooks into the ADS file handling, which dbMax hasn't. Probably ReportPro is doing rougly the same as DBV, a dbv utility from Erik Visser and Janno Hordijk from which I have the sourcecode. It's using DBFAXSAdsIsServerLoaded to determine if ADS is indeed active when an "ADS open file" command is chosen and if so, it will use AXDBFCDX. If not active or a "DBFCDX open file" command is chosen, it will use AXDBFCDX. Further only the filtering code differs in ADS.

Dick

Re: ReportPro (2) in ADS environment

Posted: Fri Apr 12, 2024 6:30 am
by Chris
Hi Dick,

It's not really that RPhooks into the ADS filesystem, you just open the files through the ADS RDD driver, which communicates with ADS and asks it to open the file and ADS does the rest internally.

Re: ReportPro (2) in ADS environment

Posted: Fri Apr 12, 2024 9:31 am
by ic2
Hmm, I would say that would only happen if I define a swap array including AXDBFCDX. And I don't do that. So how does ReportPro know that it should use ADS?

Dick

Re: ReportPro (2) in ADS environment

Posted: Fri Apr 12, 2024 11:58 am
by Chris
Hi Dick,

If you look at the properties of the dbf in the section inside RP, what driver does it say that it uses? If that's indeed not using an ADS driver, then I can't think of any other explanations than the ones mentioned before..

Re: ReportPro (2) in ADS environment

Posted: Fri Apr 12, 2024 12:24 pm
by ic2
That's DBFCDX, in the properties. And no other RDD is set when running the report from the VO program.

So that would mean that ReportPro doesn't use ADS and also that I still fail to understand why that works while dbMax fails to open a dbf in use by ads saying it is in exclusive use.

PS: Note that dbMax does have an option to open the dbf with DBF Driver CDX - FPT Memo (ADS) but when I do that I get

Can not open file ....dbf Unknown reason!

Anyhow, it remains a mystery; interesting that nobody (including myself) does actually know how it works.

Dick

Re: ReportPro (2) in ADS environment

Posted: Fri Apr 12, 2024 4:20 pm
by robert
DIck,
Anyhow, it remains a mystery; interesting that nobody (including myself) does actually know how it works.
I think I know how this works, but I did not look into your problem.
Did you ever include an example (report + code running the report +data files)?
To explain this I would have to run the example through the debugger.

Robert