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

TOPIC: Is it possible to access .DBC (VFP) databases through xSharp?

Is it possible to access .DBC (VFP) databases through xSharp? 3 months 1 week ago #10119

  Jáder E. Souza's Avatar Topic Author Jáder E. Souza Offline Posts: 3
139/5000
Is it possible to access .DBC (VFP) databases through xSharp?
Is there any provider to access DBFs through Entity Framework Core?

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

Is it possible to access .DBC (VFP) databases through xSharp? 3 months 1 week ago #10121

  robert's Avatar robert Offline Posts: 1310
Jáder,

In the current RC (FOX subscribers only) and the upcoming public release you can open a DBC file as a normal DBF file using the DBFVP RDD.
This does not mean that all the relations etc. will be automatically maintained.
More support for DBC files will be added later.

Robert
XSharp Development Team
The Netherlands

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

Is it possible to access .DBC (VFP) databases through xSharp? 3 months 1 week ago #10123

  Jáder E. Souza's Avatar Topic Author Jáder E. Souza Offline Posts: 3
Robert, thank you!
Is there any provider to access DBFs through Entity Framework Core?

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

Is it possible to access .DBC (VFP) databases through xSharp? 3 months 1 week ago #10124

  robert's Avatar robert Offline Posts: 1310
Jáder,
There is not. At this moment we are focusing on making the product ready to support existing code.
We have looked into this and when there is enough demand for such a provider then we will add one later.

Robert
XSharp Development Team
The Netherlands

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

Is it possible to access .DBC (VFP) databases through xSharp? 3 months 5 days ago #10137

  FoxProMatt_MattSlay's Avatar FoxProMatt_MattSlay Offline Posts: 276

...and the upcoming public release you can open a DBC file as a normal DBF file using the DBFVP RDD.


Once the release is publicly available, it would be nice to have a code sample (maybe a new blog post) that shows the exact lines of code that are required to open a DBF and loop over it to print or display a few of the fields the screen or in a simple dialog. Just a simple code example that VFP users can see the X# code and even copy-paste it onto a project and see it run.

I know you were just giving basic feedback, but the "using the DBFVFP RDD" will be a mystery to VFP folks, so I hope we can get a concrete "Getting Starting with X# and FoxPro DBF" document or example to tease VFPers into giving X# a test run.

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

Last edit: by FoxProMatt_MattSlay.

Is it possible to access .DBC (VFP) databases through xSharp? 3 months 5 days ago #10138

  robert's Avatar robert Offline Posts: 1310
Matt,

That is a very good idea. I am also considering to do a small video to show how to do this and to explain the concept of RDDs in relation to the various DBF formats.

Robert
XSharp Development Team
The Netherlands

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

Is it possible to access .DBC (VFP) databases through xSharp? 3 months 5 days ago #10143

  NEE4NEE's Avatar NEE4NEE Offline Posts: 4
... and if possible please add the Password protection in dbf (like ms access and others) :)

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

Is it possible to access .DBC (VFP) databases through xSharp? 3 months 5 days ago #10145

  robert's Avatar robert Offline Posts: 1310
Neeraj,
Do you mean that you want us to extend the DBF format to add password protection?
Or should we support an existing password protection system such as can be found in Harbour or as found in Successware's Six driver ?

Robert
XSharp Development Team
The Netherlands

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

Is it possible to access .DBC (VFP) databases through xSharp? 3 months 3 days ago #10154

  NEE4NEE's Avatar NEE4NEE Offline Posts: 4
Do you mean that you want us to extend the DBF format to add password protection?

YES

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

Is it possible to access .DBC (VFP) databases through xSharp? 2 months 3 weeks ago #10310

  alanbourke's Avatar alanbourke Offline Posts: 20
Adding password support to DBF files is a bad idea. It works (sort of) with Access because Access databases are monolithic, all the tables are in one MDB file.

An application using DBF files tends to have tens or hundreds of them. So how do you maintain the same password across all of them? What if there is a DBC involved, do you implement the password at DBC level?

If you need this sort of security then you should really be looking at a database server (Postgres, MSSQL, MYSQL, whatever).

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

Is it possible to access .DBC (VFP) databases through xSharp? 2 months 2 weeks ago #10434

  pluisje's Avatar pluisje Offline Posts: 1
Matt Slay wrote:

it would be nice to have a code sample that shows the exact lines of code that are required to open a DBF and loop over it to print or display a few of the fields the screen or in a simple dialog. [...] I know you were just giving basic feedback, but the "using the DBFVFP RDD" will be a mystery to VFP folks,

I second that very much!
Speaking for myself: coming from VFP and PHP (Notepad++), Visual Studio is also new to me.
So when the VFP-dialect is running, I will be looking for a small "Hello World".

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

Is it possible to access .DBC (VFP) databases through xSharp? 2 months 2 weeks ago #10436

  lumberjack's Avatar lumberjack Offline Posts: 610

pluisje wrote: Matt Slay wrote:

it would be nice to have a code sample that shows the exact lines of code that are required to open a DBF and loop over it to print or display a few of the fields the screen or in a simple dialog. [...] I know you were just giving basic feedback, but the "using the DBFVFP RDD" will be a mystery to VFP folks,

I second that very much!
Speaking for myself: coming from VFP and PHP (Notepad++), Visual Studio is also new to me.
So when the VFP-dialect is running, I will be looking for a small "Hello World".

Well depending what type of "Hello World" you looking for:

Console app
FUNCTION Start() AS VOID
  ? "Hello World"
RETURN
Lets do it as a form:
FUNCTION Start() AS VOID
  VAR oForm := MyFirstXSharpForm() // Note X# understand both () and {} for object creation
  Application.Run(oForm)
RETURN

CLASS MyFirstXSharpForm INHERIT Form 
  CONSTRUCTOR() // Or INIT() in the VFP language syntax
    SUPER()
    Size := Size(100, 100) // In the VFP syntax assignment can also be done by "="
    Text := "My first XSharp Form"
    BackColor := Color.Blue
    VAR btn := Button()
    btn.Text := "Close"
    btn.Location := Point(5,5)
    btn.Click := MyButtonClick
    Controls.Add(btn)
  RETURN
  METHOD MyButtonClick(o AS OBJECT, e AS EventArgs) AS VOID
    MessageBox.Show("Good bye my first X# form")
    Close()
  RETURN
END CLASS // Also understand ENDDEFINE
Ok, I know this is not 100% complete, but hopefully gives an idea to VFP users not yet trying to do anything in X#.
______________________
Johan Nel
George, South Africa

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

Last edit: by lumberjack.

Is it possible to access .DBC (VFP) databases through xSharp? 2 months 2 weeks ago #10437

  lumberjack's Avatar lumberjack Offline Posts: 610
Hi Matt,

FoxProMatt_MattSlay wrote: Once the release is publicly available, it would be nice to have a code sample (maybe a new blog post) that shows the exact lines of code that are required to open a DBF and loop over it to print or display a few of the fields the screen or in a simple dialog. Just a simple code example that VFP users can see the X# code and even copy-paste it onto a project and see it run.

With the public GA to be released soon, here is a bit of "DBFVFP" background.

First thing, one need to understand the pre-processor. In that context the following from the X# include folder in the file dbCmd.xh:
#command USE                            => dbCloseArea()

#command USE <(db)>                                                     ;
             [VIA <rdd>]                                                ;
             [ALIAS <a>]                                                ;
             [<new: NEW>]                                               ;
             [<ex: EXCLUSIVE>]                                          ;
             [<sh: SHARED>]                                             ;
             [<ro: READONLY>]                                           ;
             [INDEX <(index1)> [, <(indexn)>]]                          ;
                                                                        ;
      => dbUseArea(                                                     ;
                    <.new.>, <rdd>, <(db)>, <(a)>,                      ;
                    if(<.sh.> .or. <.ex.>, !<.ex.>, NIL), <.ro.>        ;
                  )                                                     ;
                                                                        ;
      [; dbSetIndex( <(index1)> )]                                      ;
      [; dbSetIndex( <(indexn)> )]
The trick to see how the command is translated into a function call is the optional VIA part. That allows us to tell the system what driver we want to use. There are a couple of surprises that this allows us to do using the Replaceable Database Driver (RDD) concept:
USE "c:\blah\blah" VIA "DBFVFP"
USE "c:\blah\blah.csv" VIA "DELIM" FIELDS {{"Name", "C", 10, 0}, {"LastName", "C", 30, 0}}  DELIMITER ","
There is also a function RddSetDefault("DBFVFP") that we can use at startup to set the default RDD if we want to omit the VIA clause.

Hope this is of interest to some.
______________________
Johan Nel
George, South Africa

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

Last edit: by lumberjack.
  • Page:
  • 1