fbpx
Welcome, Guest
Username: Password: Remember me
This public forum is meant for questions and discussions about Visual FoxPro
  • Page:
  • 1

TOPIC:

Data access with X# to VFP tables 28 May 2021 11:29 #18685

  • Markus


  • Posts: 3
  • Hello all,
    we develop a VFP software for social services, it is used by many clients on individual computers. The use of SQL servers is to come in the future, but will rather be something for customers where the data is on a server. For customers with single installations, free VFP tables are still very important. Bit by bit, we want to migrate the software to .Net. To do this, we need access to the VFP tables. Currently, we have developed a VFP-Com server for this purpose, which we use to fetch the data to .Net and also write them back again. The data is loaded via CursorAdapter and transferred via Json or as objects.
    Now we have become aware of X# and find it very interesting. Here it is quite easy to load VFP data with a USE and use it in .Net projects. But how does this work technically? Is it the same as in VFP? There are some problems with direct access via USE (e.g. network crashes). What is the best way to load data from VFP tables in X# so that the whole thing also works securely in the network and with access by several users? Is there also something like CursorAdapter or do I not need them at all? Where can I find documentation on this topic?

    If X# is a good and secure way of accessing data and if some of the VFP code can be transferred to .Net, that would be a great invention that should be dealt with more intensively.

    Many thanks for some beginner input
    Markus

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

    Data access with X# to VFP tables 29 May 2021 09:53 #18687

    • RGreim4XS


  • Posts: 38
  • Hello Markus,
    Wolfgang pointed me to MVVM. Don’t know this is the best option. Why not keep the VFP.com , and do the Rest in X# .
    Im also using VFP since FP2.5 Dos, but some say keep VFP some say don’t use it anymore..
    Maybe for single user a switch to SQLite would be an option. Or the multiuser version ( Valentina).
    For me I have switched to Postgres ( thanks to Wolfang…).


    BR Rainer

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

    Data access with X# to VFP tables 30 May 2021 11:36 #18688

    • Markus


  • Posts: 3
  • Hello Rainer,

    yes, we use .Net (with C#), WPF with MVVM and the EF for a while. I know all that. Our problem is that the VFP application has a lot of forms and we have to convert them to cursor adapters first, then we can switch to another database. At the same time, we want to migrate various modules to .Net, so we need read and write access to the existing VFP tables. Access via Com using our service works, but COM has its own peculiarities (must be registered or requires a manifest) and makes debugging difficult. The idea was therefore to access the VFP data directly from .Net using X#. We would be interested to know how this is technically implemented. Is it also possible internally via COM or are the tables opened directly as files? How reliably does this work (also multi-user and network)? Does anyone have experience? If X# is not an alternative, we will stay with the VFP ComService.

    Many thanks
    Markus

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

    Data access with X# to VFP tables 30 May 2021 12:57 #18689

    • RGreim4XS


  • Posts: 38
  • Hallo, Markus, sounds like a lot of work, hope you have plugins/ wizards to help you.
    And hope it’s more than bringing VFP SW to .net.
    BR Rainer

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

    Data access with X# to VFP tables 30 May 2021 15:56 #18692

    • robert
    • robert's Avatar


  • Posts: 2222
  • Markus,
    The VFP data access in X# works through a native X# data access layer (which we call RDD). This is written in X# of course.
    We have added what we call "User Defined Commands" that translate the familiar VFP commands such as USE, SKIP, SCAN etc to function calls which in their turn call methods from the RDD layer.
    About the reliability for multi user and in a network: this is just as reliable or unreliable as VFP.
    You have to make sure that the caching parameters for shared file access are set correctly at every workstation that opens and updates a file.

    Robert
    XSharp Development Team
    The Netherlands

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

    Data access with X# to VFP tables 30 May 2021 16:05 #18693

    • wriedmann
    • wriedmann's Avatar


  • Posts: 2633
  • Hi Markus,
    about the architecture of the DBF access in X#: as you may know, X# comes from VO and like Clipper 5 and VO it implements data access to DBF tables using so called RDDs (Replaceable Database Driver).
    Then there is the functional layer like Clipper had it.
    Over this, using the powerful preprocessor, there are both a class layer with the DBServer class (from VO) and a command layer like Clipper and VFP with "use area".
    Since I'm a VO guy and have absolutely no knowledge about VFP, maybe others can explain you better what you can do.
    Wolfgang
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

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

    Data access with X# to VFP tables 11 Jun 2021 10:09 #18782

    • Markus


  • Posts: 3
  • Hello and thank you for the answers!

    Since I have absolutely no idea about VO, these statements rather motivate me to continue with my own VFP service. Or are there VFP developers here who already have experience with data access to native VFP tables using X#? Does anyone do this and already have practical experience?

    Many thanks
    Markus

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

    Data access with X# to VFP tables 11 Jun 2021 10:14 #18783

    • wriedmann
    • wriedmann's Avatar


  • Posts: 2633
  • Hi Markus,
    maybe it is better to show a few lines of code to see how you would like to access your tables from your application. Then someone could step in and says how this can work with X#
    Wolfgang
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

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

    • Page:
    • 1