Startbeitrag von DanMam 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 ...
WHEN EXCEPTION IN
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)
WHEN EXCEPTION IN
bDataExists = HOpen(ICSource)
DO
bDataExists = False
END
================================
Any ideas or help is greatly appreciated
Dan
Everything works up to the point where "bConnectionChanged" returns TRUE.
Then when ...
WHEN EXCEPTION IN
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)
WHEN EXCEPTION IN
bDataExists = HOpen(ICSource)
DO
bDataExists = False
END
================================
Any ideas or help is greatly appreciated
Dan
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")
END
WHILE NOT HOut (ICSource)
nTotalResult += ICSource.Quantity
Trace(ICSource.Quantity,ICSource.CompanyName)
HReadNext(ICSource)
END
RESULT "Available Qty: " + nTotalResult
ELSE
RESULT "No Available Qty"
END
============================================
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
Maybe you can use connection..sourcename to find out the map of your data files?
von Arie Mars - am 25.10.2009 16:44
If you are in server code, you should be able to use fExtractPath to find out where the file is created. Also check fDataDir.
Jeff
von Jeff Graham - am 27.10.2009 22:53