Welcome, Guest
Username: Password: Remember me
Welcome to the XSharp forum!

Tell us and our members who you are, what you like and why you became a member of this site.
We welcome all new members and hope to see you around a lot!
  • Page:
  • 1

TOPIC:

Trying to access DBF/CDX through ADS with bTools.bServer 03 Aug 2021 16:46 #19240

  • hilberg.it
  • hilberg.it's Avatar
  • Topic Author


  • Posts: 60
  • Hi,
    I am a new user to X# and I am fascinated by the project. Also still a bit confused. Please excuse some newbie errors. At the moment I am trying to access DBF/CDX files from a remote ADS instance using X# in VisualObjects Dialect.

    At the time I cannot access the CDX files and special characters aren't displayed correctly.

    I am using XSharp.RDD with RDDSETDEFAULT("AXDBFCDX") and supplied all the required DLLs like ace32.dll. The code looks something like this:
    SetAnsi(true)
    RDDSETDEFAULT("AXDBFCDX")
    
    LOCAL _oDbArtikel as bDBServer
    _oDbArtikel = bDBServer{"\\<IP>:<PORT>\ADSTest\dArtikel"}
    
    IF !_oDbArtikel:setIndex (\\<IP>:<PORT>\ADSTest\dArtikel.cdx")
    	 Infobox{,,"Index-File cannot be opened!"}:show()
    ENDIF
    
    IF _oDbArtikel:seek("1234")
         System.Console.WriteLine("Art: " + (string)_oDbArtikel:fieldGet(#Arname))
    ELSE
         System.Console.WriteLine("Art not found!")
    ENDIF   
    _oDbArtikel:Close()

    I can access the DB, but unfortunately I cannot set the index with :setIndex and special characters are not displayed correctly.

    Any hints would be highly appreciated!
    Thanks already!

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

    Trying to access DBF/CDX through ADS with bTools.bServer 03 Aug 2021 17:22 #19243

    • wriedmann
    • wriedmann's Avatar


  • Posts: 3191
  • Hi,
    first of all: welcome here!
    A question: why do you are using SetAnsi( true ) if SAP recommends to use SetAnsi( false )?
    And the second: AFAIK ADS auto-opens the index file so you need to set the controlling order using SetOrder() specifying the controlling index.
    Wolfgang
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

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

    Trying to access DBF/CDX through ADS with bTools.bServer 03 Aug 2021 21:40 #19247

    • hilberg.it
    • hilberg.it's Avatar
    • Topic Author


  • Posts: 60
  • Thanks!

    AFAIK ADS auto-opens the index file so you need to set the controlling order using SetOrder() specifying the controlling index.

    That is a nice catch! So I don't need to open the CDX file at all. :)

    why do you are using SetAnsi( true ) if SAP recommends to use SetAnsi( false )?

    Also good point. Do you have a link where SAP recommends this? Because I think the devzone page is down. devzone.advantagedatabase.com/

    PS. I got the special chars to show up by removing a line
    SetCollation(#CLIPPER)

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

    Trying to access DBF/CDX through ADS with bTools.bServer 04 Aug 2021 05:17 #19249

    • wriedmann
    • wriedmann's Avatar


  • Posts: 3191
  • Hello,
    unfortunately I don't have any links - I have two (paper) books here, and in both there is the recommendation.
    About autoopen the index: even the DBFCDX RDD does that, and it has done that since Clipper days.
    The index file is opened if it has the same name as the dbf file.
    Wolfgang
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

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

    Trying to access DBF/CDX through ADS with bTools.bServer 04 Aug 2021 11:06 #19253

    • ic2
    • ic2's Avatar


  • Posts: 1553
  • Hello,

    hilberg.it wrote: Do you have a link where SAP recommends this? Because I think the devzone page is down. devzone.advantagedatabase.com/


    First the requested link:
    devzone.advantagedatabase.com/dz/webhelp...tored_procedures.htm

    Here you will read:
    "In order for the Advantage RDD to work properly, the SetAnsi value must be False. The Advantage RDD takes care of all conversion and always returns the data in the native Windows format-ANSI. If you incorrectly set SetAnsi() to True in your Advantage application, Visual Objects will incorrectly assume the data from the Advantage RDD is not ANSI and will also perform conversion, which will corrupt your data. The Advantage Visual Objects RDD will use the SetCollation() value to determine if ANSI conversion is necessary as explained below."

    (you can easily assume that Wolfgang is right in most things he writes, he's our X#ikipedea here ;)

    The official ADS page for ADS from SAP is wiki.scn.sap.com/wiki/pages/viewpage.action?pageId=340329321. SAP has mainly neglected ADS, so it's good that if you still need to order licenses, you can do that via X#.

    Dick

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

    • Page:
    • 1