Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 7 Jahren, 1 Monat
Letzter Beitrag:
vor 7 Jahren, 1 Monat
Beteiligte Autoren:
DanM, Jeff Graham, Arie

HOpen works in WinDev but not WebDev ???

Startbeitrag von DanM am 24.10.2009 21:35

The following code works in my WinDev application but does not work in my WebDev application. (see code at bottom of message)

Everything works up to the point where "bConnectionChanged" returns TRUE.

Then when ...

bDataExists = HOpen(ICSource)

... is run, bDataExists returns FALSE ??????? Why can't this file be opened ... it does exist?

When I run this code in my WinDev test application bDataExists Returns TRUE and everything works well ... but the exact same code running in WebDev and bDataExists returns FALSE ????

I have run it through the debugger and checked to verify the file does exist right before the WHEN EXCEPTION code runs and it does exist.

Any ideas on Why this file cannot be opened or How to debug this?


MyTestConnection is Connection

// Connection Settings
MyTestConnection..Provider = hNativeAccessXML
MyTestConnection..User = ""
MyTestConnection..Password = ""
MyTestConnection..Source = sPath + sFilename
MyTestConnection..Database = "ICSource"
MyTestConnection..Access = hOReadWrite

bDataExists is boolean = False

bFileExists is boolean = HClose(ICSource)
bFileWasSaved is boolean = fSaveText(sPath + sFilename, sMyResponseXML)
bConnectionChanged is boolean = HChangeConnection(ICSource,MyTestConnection)
bDataExists = HOpen(ICSource)

bDataExists = False


Any ideas or help is greatly appreciated



Well, out of shear confusion I just started changing things, one at a time.

I changed the HOpen command to HCreationIfNotFound in the line

bDataExists = HOpen (ICSource).

After that the bDataExist = TRUE but of course did not work because it was creating a new file since it could not find the existing one.

So I changed the HCreationIfNotFound back to HOpen and ???? Now bDataExists is = TRUE with the Hopen command.

Well, unfortunately, my saga continues ... now in this section

IF bDataExists THEN
nTotalResult is int
bReadIT is boolean = HReadFirst(ICSource)
IF HErrorLock THEN
Error("A lock error occurred")
nTotalResult += ICSource.Quantity
RESULT "Available Qty: " + nTotalResult
RESULT "No Available Qty"

bReadIT = FALSE (which means it cannot read the first record????)

Thererfore HOut =TRUE and the whole next section is not executing!

Again, I have opened the existing file in a browser and the XML data is there and there are several records ... ??

Something seems quirky ... Has anyone ever experienced anything like this?

Could this be machine related??

Any ideas on how to trouble shoot this ??

von DanM - am 25.10.2009 01:48
It looks like your file ICSource is created again, at some other place.
Maybe you can use connection..sourcename to find out the map of your data files?

von Arie - am 25.10.2009 16:44
Are you working in server code or browser code?

If you are in server code, you should be able to use fExtractPath to find out where the file is created. Also check fDataDir.


von Jeff Graham - am 27.10.2009 22:53
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.