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

TOPIC:

DBServer object doesn't allow :SetOrder 12 Aug 2022 12:58 #23276

  • FdeRaadt
  • FdeRaadt's Avatar
  • Topic Author


  • Posts: 24
  • Hello All,

    I've found something within my code that doesn't make sense.
    I have the following code:
    if Upper(cDatapath)==cTESTDIR
    	oKmTabel := Dbserver{"F:\IC2TEST\"+"KMTab16mp.adt", true, false, "ADSADT"}
    else
    	oKmTabel := Dbserver{cTracePad+"KMTab16.adt", true, false, "ADSADT"}
    endif
    
    oKmtabel:SetOrder("KM1")
    Error: No Exported method 'SETORDER'

    Within this code, we make a DbServer object using the SetOrder method as the controlling order.

    I've looked into This post states that "If oServer is declared as DataServer then the method SetOrder is not available. So this will not compile." Robert 2018-12-07 11:03:01

    But it does compile but leads to crashes upon calling the SetOrder method.

    Now my solution that works for this problem is subclassing the DBServer class which still INHERITS from DBServer but magically works.
    Can somebody explain to me why using the SetOrder method directly on a DBserver object doesn't work?

    Frank

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

    DBServer object doesn't allow :SetOrder 12 Aug 2022 13:20 #23278

    • robert
    • robert's Avatar


  • Posts: 3106
  • Frank,
    How is oKmTabel declared ?

    Robert
    XSharp Development Team
    The Netherlands

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

    DBServer object doesn't allow :SetOrder 12 Aug 2022 13:28 #23280

    • FdeRaadt
    • FdeRaadt's Avatar
    • Topic Author


  • Posts: 24
  • LOCAL oKmTabel as object

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

    DBServer object doesn't allow :SetOrder 12 Aug 2022 13:36 #23281

    • robert
    • robert's Avatar


  • Posts: 3106
  • Frank,
    If you declare a variable "as object" then the compiler does not know which methods exist.
    So the error message is correct.
    Change "as object" to "as dbserver" and the code will compile without errors.

    Robert
    XSharp Development Team
    The Netherlands

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

    DBServer object doesn't allow :SetOrder 12 Aug 2022 13:36 #23282

    • Chris
    • Chris's Avatar


  • Posts: 3539
  • Hi Frank,

    This should had worked fine, What is "oKmTabel" defined as?

    Edit: Oh, I see you have already answered that. Since the error is the runtime one, something must have changed the type of the var in your code. Can you please post the complete code?
    XSharp Development Team
    chris(at)xsharp.eu

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

    Last edit: by Chris.

    DBServer object doesn't allow :SetOrder 12 Aug 2022 15:34 #23283

    • ic2
    • ic2's Avatar


  • Posts: 1525
  • Hello Robert & Chris,

    I created a very basic example which worked:
    local oKmTabel as object
    oKmTabel := DbServer{"c:\temp\somefile.dbf"}
    oKmTabel:setorder("someorder")

    The very same code didn't work in Frank's program. Then we noticed that In Frank's program the object was of XSharp.VO.SDK.DbServer while on my program it was XSharp.VO.DbServer.

    Then I noticed that in my sample there was a reference to XSharp.Rdd while in Frank's program it was XSharp.VORDDClasses.

    I think the latter is meant when working with no GUI, right? But it seems to be the cause. Using this reference instead of XSharp.RDD in the above code, SetOrder fails.

    Any reason for that?

    Dick

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

    DBServer object doesn't allow :SetOrder 12 Aug 2022 15:43 #23285

    • Chris
    • Chris's Avatar


  • Posts: 3539
  • Hi Dick,

    The XSharp.VO***Classes.dll files, are the new versions of the SDK libraries, which are typed and meant to be possible replacements to the regular VOSDK libraries at some point in the future. They are not fully compatible with the original classes (at least not yet) and are only distributed for evaluation for FOX subscribers only. What you need to use is the VO*Classes.dll libraries instead.

    The library XSharp.Rdd is used automatically at runtime when needed and you do not need to have a reference to it in your projects.
    XSharp Development Team
    chris(at)xsharp.eu

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

    DBServer object doesn't allow :SetOrder 12 Aug 2022 19:02 #23288

    • ic2
    • ic2's Avatar


  • Posts: 1525
  • Hello Chris,

    Thanks for explaining.

    They are not fully compatible with the original classes (at least not yet)

    Then it's probably good to log that SetOrder doesn't work there now?

    It also explains why it did work when we changed Class dbServer to Class OurdbServerSubclass, as this subclass was defined in a library which referenced XSharp.RDD (as it should have been everywhere obviously).

    Dick

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

    DBServer object doesn't allow :SetOrder 13 Aug 2022 00:07 #23296

    • Chris
    • Chris's Avatar


  • Posts: 3539
  • Hi Dick,

    Actually those classes do have SetOrder() defined, but the problem is that there multiple overloads and this causes this problem when trying to call it with late bound code. Anyway, those classes are not ready to be used in production, but we will overview them all when they get "officially" released some months later
    XSharp Development Team
    chris(at)xsharp.eu

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

    • Page:
    • 1