Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Access FPT from ADS with XSharp VO Dialect - Error 7010 02 Sep 2021 17:01 #19500

  • hilberg.it


  • Posts: 9
  • Hi,
    I have difficulties trying to access a MEMO field from a DBF/FPT file through an ADS Server. Code fails with ADS Error 7010 as soon as the memo field is not empty.
    Does anyone know, if I am missing a config?

    Error:
    Description :    Error 7010:  Problem with Advantage server file read.
    Subsystem :    AXDBFCDX
    GenCode :    EG_READ Read error
    SubCode :    7010 Error 7010:  Problem with Advantage server file read.
    FuncSym :    FIELDGET 

    Code looks something like this:
    RDDSETDEFAULT("AXDBFCDX")
    
    LOCAL _oDbArtikel as bDBServer
    _oDbArtikel = bDBServer{"\\<IP>:<PORT>\ADSTest\dArtikel"}
    
    FOR j:=1 UPTO 100
                System.Console.WriteLine(j:ToString() + " Artikel: " + (string)_oDbArtikel:fieldGet(#Arname) + " - " +" Memo: " + (string)_oDbArtikel:fieldGet(#MY_MEMO))
                _oDbArtikel:skip(1)
            NEXT j
    
    _oDbArtikel:Close()

    Please Log in or Create an account to join the conversation.

    Access FPT from ADS with XSharp VO Dialect - Error 7010 02 Sep 2021 18:06 #19501

    • Jamal


  • Posts: 253
  • It could be the memo block size.

    Check this out:

    devzone.advantagedatabase.com/dz/webhelp...server_file_read.htm

    Please Log in or Create an account to join the conversation.

    Access FPT from ADS with XSharp VO Dialect - Error 7010 03 Sep 2021 10:46 #19508



  • Posts: 55
  • Hi,

    you have to set the blocksize lager then 32:
    RDDINFO(_SET_MEMOBLOCKSIZE, 64)
    and THEN create your file with MEMO field.
    The block size is stroed in the DBF header.

    HTH

    Gerhard Bunzel

    Please Log in or Create an account to join the conversation.

    Access FPT from ADS with XSharp VO Dialect - Error 7010 03 Sep 2021 11:12 #19509

    • robert
    • robert's Avatar


  • Posts: 2308
  • Gerhard,
    You are right, but with one small correction: the Block size is stored in the FPT header (as a 16 bit number in the 0 based location 06-07)
    If you have a "flexfile compatible" FPT file (which you can recognize because at location 512 there is a string "FlexFile3") then there may be an "alternative block size" defined in the file at location 28 - 29 in the FlexFile header (which starts at location 512). This allows block sizes < 32.

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    Access FPT from ADS with XSharp VO Dialect - Error 7010 03 Sep 2021 17:54 #19511



  • Posts: 55
  • Hi Robert,

    ....thanks for correction.

    Gerhard

    Please Log in or Create an account to join the conversation.

    Access FPT from ADS with XSharp VO Dialect - Error 7010 03 Sep 2021 23:09 #19512

    • hilberg.it


  • Posts: 9
  • Thank you very much for your input!

    If I recap correctly, you are suggesting that I create a new DBF/FPT file with an Advantage db-driver and blocksize 64 and copy the content from the not-compatible db file into it? Sounds like it is a bit of work, but it could work.

    I cannot determine where the dbfcdx.rdd comes from. The DB was last used with VO 2.8. But maybe it was created with an earlier version. So I cannot say for sure if the file is compatible or not. I tried to read the FPT header. At pos. 512 I can read 'FlexFile3'. But if I convert the pos 0-512 from ASCII to HEX, I cannot find any useful information about the applied blocksize. Or would HEX 20 mean blocksize 32?! It's a bit hard to figure out where pos 06-07 respectively 28-29 starts.

    Any hints, how I could say for sure, if the FPT file is Advantage-compatible or not?

    Thank you very much already. You guys a very helpful!

    The FPT header looks like this pos. 0-512:
    2020287F202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    FlexFile3

    Please Log in or Create an account to join the conversation.

    Access FPT from ADS with XSharp VO Dialect - Error 7010 04 Sep 2021 09:28 #19513

    • robert
    • robert's Avatar


  • Posts: 2308
  • That header looks corrupt to me.
    No wonder that ADS cannot open the file.
    I suggest you do this
    - open the file in VO
    - get its structure (DBStruct())
    - close the file
    - set the memoblock size to 64
    - create a new file with DbCreate() using the structure you read
    - use an Append from to append the data from the existing file into the new file
    - close the new file
    - delete or move the old file to another folder
    - rename the new file so it gets the same name as the old one
    - open that file
    - reindex

    That should create a new file and new FPT
    The new FTP should have all zeros in the first 512 bytes with a few exceptions, for example the bytes 06-07 when 64 is written for the new block size (hex 0x40)

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    Access FPT from ADS with XSharp VO Dialect - Error 7010 10 Sep 2021 23:11 #19553

    • hilberg.it


  • Posts: 9
  • Thanks Robert. I am trying to code it. So far I am stuck with the APPEND FROM call in VO2.8
    LOCAL _oDbArtikel as bDBServer
    LOCAL _aStruData	as ARRAY
    _oDbArtikel = bDBServer{"C:\tmp\dArtikel"}
    _aStruData := _oDbArtikel:DbStruct
    _oDbArtikel:Close()  
    RDDINFO(_SET_MEMOBLOCKSIZE, 64)                                              
    DBCREATE("C:\tmp\test", _aStruData) 
    // here APPEND FROM "C:\tmp\dArtikel"

    How should I write the APPEND FROM call? I don't know the syntax. I've just found this Doc CA-Clipper Docs

    Header so far looks a bit different already, especially the bytes 6-7 with hex 0x40:
    20202010202020402020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020
    20202020202020202020202020202020

    If you could help me with coding the append call, I could test the result :-) Thx

    Please Log in or Create an account to join the conversation.

    Access FPT from ADS with XSharp VO Dialect - Error 7010 11 Sep 2021 12:15 #19555



  • Posts: 55
  • You will find every syntax in the X#-Help:
    www.xsharp.eu/runtimehelp/html/M_XSharp_RT_Functions_DbApp.htm

    HTH

    Gerhard

    Please Log in or Create an account to join the conversation.

    Access FPT from ADS with XSharp VO Dialect - Error 7010 11 Sep 2021 22:48 #19562

    • hilberg.it


  • Posts: 9
  • Thanks so much! That worked. :-)

    But unfortunately I received for one of two files that I was trying to move to ADS a "Corruption Detected" Error (In Function FlexGetMemoData; On Line: 1340; Function DbApp). See attachment.

    Any ideas, if I could use in this case something else than "DBApp()"? Or recover the file somehow? I can still open it in VO, though. I could see nothing in the file at line 1340. But it could be that the file is indeed corrupted. I am thinking about a loop that reads from the corrupted file in VO and inserts entry by entry into the new file. Are there better solutions?

    Please Log in or Create an account to join the conversation.

    Last edit: by hilberg.it.

    Access FPT from ADS with XSharp VO Dialect - Error 7010 12 Sep 2021 11:01 #19570

    • FFF


  • Posts: 1177
  • the attachment didn't make it ;)
    But, anyway, i see a similiar problem, which is reproducable, using plain VoRdd, just sent sample with data to Chris, so give the guys a day or two to fix this...
    Regards
    Karl (X# 2.7; Xide 1.27; W8.1/64 German)

    Please Log in or Create an account to join the conversation.

    Access FPT from ADS with XSharp VO Dialect - Error 7010 12 Sep 2021 11:10 #19571

    • hilberg.it


  • Posts: 9
  • Hi FFF,
    sounds interesting. Could you provide more insights to your problem? What is it about? When does it happen? Where can I follow the ticket or PR and see if it has been fixed?

    Thanks.

    Please Log in or Create an account to join the conversation.

    Last edit: by hilberg.it.

    Access FPT from ADS with XSharp VO Dialect - Error 7010 12 Sep 2021 13:16 #19572

    • FFF


  • Posts: 1177
  • Out of curiosity, I followed your sample to copy a table, but using plain DBFCDX, and got a corruption error, resulting in only a part of the table copied...
    But some patience, pls, i sent the sample only two hours ago to greece. The guys are QUICK, but give them a chance ;-)
    Regards
    Karl (X# 2.7; Xide 1.27; W8.1/64 German)

    Please Log in or Create an account to join the conversation.

    Access FPT from ADS with XSharp VO Dialect - Error 7010 12 Sep 2021 18:25 #19573

    • hilberg.it


  • Posts: 9
  • Thank you for your effort! Same result that I've got. Sorry for me being impatient. So you think, the problem could be caused by the RDD and not the FPT file being corrupt? Please keep me posted.

    Please Log in or Create an account to join the conversation.

    Access FPT from ADS with XSharp VO Dialect - Error 7010 12 Sep 2021 19:21 #19574



  • Posts: 55
  • I don't think it's a RDD problem.
    In your FPT-File check your MEMO-Fields Field by Field and Record by Record. Do that test with the DBFCDX-RDD - not with ADS.
    Here you will find some old code for a file check - not tested by me.
    groups.google.com/g/comp.lang.clipper.vi...mE5Yg/m/0OmrnuY9ctgJ

    HTH

    Gerhard

    Please Log in or Create an account to join the conversation.

    Access FPT from ADS with XSharp VO Dialect - Error 7010 12 Sep 2021 19:29 #19575

    • FFF


  • Posts: 1177
  • I would simply wait. Dev has a reproducible sample, so i'm confident they'll fix this soon.
    Regards
    Karl (X# 2.7; Xide 1.27; W8.1/64 German)

    Please Log in or Create an account to join the conversation.

    Access FPT from ADS with XSharp VO Dialect - Error 7010 13 Sep 2021 02:04 #19576

    • Chris
    • Chris's Avatar


  • Posts: 2667
  • hilberg.it wrote: Hi FFF,
    sounds interesting. Could you provide more insights to your problem? What is it about? When does it happen? Where can I follow the ticket or PR and see if it has been fixed?

    Thanks.


    I have just looked into the file that Karl (or aka FFF :)) has sent and I can reproduce the problem (it's most probably in the RDD), tomorrow I will try to narrow it down a bit and then will open a ticket for it and will post a link to it here.

    In the meantime, maybe you could also send me the files that cause the problem in your application? Most probably the problem is exactly the same as the one shown by Karl's files, but it is also possible that yours expose a slightly different problem. Better make sure that both cases will be fixed...
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    Access FPT from ADS with XSharp VO Dialect - Error 7010 13 Sep 2021 19:35 #19586

    • Chris
    • Chris's Avatar


  • Posts: 2667
  • hilberg.it wrote: Thanks so much! That worked. :-)

    But unfortunately I received for one of two files that I was trying to move to ADS a "Corruption Detected" Error (In Function FlexGetMemoData; On Line: 1340; Function DbApp). See attachment.

    Any ideas, if I could use in this case something else than "DBApp()"? Or recover the file somehow? I can still open it in VO, though. I could see nothing in the file at line 1340. But it could be that the file is indeed corrupted. I am thinking about a loop that reads from the corrupted file in VO and inserts entry by entry into the new file. Are there better solutions?



    With Karl's files, I could see two problems:

    - In X#, I get a runtime error about a corrupted index, while appending records with AppendDB() to a new file. If I reindex the dbf first, then the error goes away. VO does not report an error with the index at all, but maybe it just ignored the problem in the index, will look further into this.

    - In X#, after I reindex, then the import happens without problems at all. On the other hand, if I run the same code in VO with the same set of files, I get the error you also mentioned, about corrupted fpt contents. In X# I never get such an error.

    So, just to be certain we are in the same page, when and where do you get the ftp corruption error? Is it from your X# or from the VO app? If it's from X#, you please show the code that executes when this error happens?
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    Access FPT from ADS with XSharp VO Dialect - Error 7010 13 Sep 2021 22:48 #19588

    • hilberg.it


  • Posts: 9
  • Chris wrote: So, just to be certain we are in the same page, when and where do you get the ftp corruption error? Is it from your X# or from the VO app? If it's from X#, you please show the code that executes when this error happens?


    Ok, I was receiving the error in VO with code below. And I am using RDDSETDEFAULT("DBFCDX") for the transformation. Don't know about Karl though. If I try the code below in X# the DbApp() call doesn't append the data to the new file. How does your code look like, with which you are able to import in X#?
    LOCAL _oDbArtikel as bDBServer
    LOCAL _aStruData	as ARRAY
    _oDbArtikel = bDBServer{"C:\source\dArtikel"}
    _aStruData := _oDbArtikel:DbStruct
    _oDbArtikel:Close()  
    RDDINFO(_SET_MEMOBLOCKSIZE, 64)                                              
    DBCREATE("C:\tmp\dArtikel", _aStruData)
    DBUSEAREA(true,, "C:\tmp\dArtikel")   
    DbApp("C:\source\dArtikel")  
    DBCLOSEALL()

    Please Log in or Create an account to join the conversation.

    Last edit: by hilberg.it.

    Access FPT from ADS with XSharp VO Dialect - Error 7010 14 Sep 2021 01:23 #19589

    • Chris
    • Chris's Avatar


  • Posts: 2667
  • hilberg.it wrote:

    Chris wrote: So, just to be certain we are in the same page, when and where do you get the ftp corruption error? Is it from your X# or from the VO app? If it's from X#, you please show the code that executes when this error happens?


    Ok, I was receiving the error in VO with code below. And I am using RDDSETDEFAULT("DBFCDX") for the transformation. Don't know about Karl though. If I try the code below in X# the DbApp() call doesn't append the data to the new file. How does your code look like, with which you are able to import in X#?
    LOCAL _oDbArtikel as bDBServer
    LOCAL _aStruData	as ARRAY
    _oDbArtikel = bDBServer{"C:\source\dArtikel"}
    _aStruData := _oDbArtikel:DbStruct
    _oDbArtikel:Close()  
    RDDINFO(_SET_MEMOBLOCKSIZE, 64)                                              
    DBCREATE("C:\tmp\dArtikel", _aStruData)
    DBUSEAREA(true,, "C:\tmp\dArtikel")   
    DbApp("C:\source\dArtikel")  
    DBCLOSEALL()


    With DBFCDX, this code runs without issues with the specific files I have. With using the ADS driver, I do get an error, but I think that's to be expected, since the memoblock size is not correct. If I recreate the file with the ADS driver, then DbApp() again works as expected.

    I am afraid it is very difficult to investigate such possible problems, by using other people's data. We'd really need to have a set of sample files from you, to tell what and if there's some issue. What about deleting all your critical data and enter some dummy data in your files and send those instead (if this still reproduces the problem of course) ?
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    Last edit: by Chris.
    • Page:
    • 1