visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
315 experts, 1193 registered users, 1659 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


05/10/2011 1h30 : Steve Jobs is dead, the father of Apple ][ is gone, we are all orphaned.

Languages :: Delphi :: Access my dbf through LAN


By: ginsonic Romania  Date: 11/07/2003 00:00:00  English  Points: 500 Status: Answered
Quality : Excellent
I have couple dbf ( fox tables ) to a omputer. I wish to access these files from four different systems. How can I read and write the changes for these files ?

I wish to have independend access to dbf for each of the four systems.

To suppose that I read to PC1 the database dbf1 and I add a record. In same time the PC2 and PC4 read same table and add each an independent record.

After that all systems must refresh the DBGrid ( for example ) displayed dates with new omes.

Code please and if 3th part libraries are involved then must be freeware with sources. No money to buy suplimentar licenses :(

Thanks for your attention,
Nick
By: FrankTheRat Date: 11/07/2003 01:20:00 English  Type : Assist
I would definitely not recommend using DBF's if you're building a desktop DB application to be used by multiple users. You should only use in a Client-Server architecture, and then you'll have to ensure the Server application takes care of record locking. The problem is less to do with the different PCs all trying to add records (although that's bad enough), and more to do with more than one PC trying to edit the same record.

If you must use this sort of DB, I'd suggest Paradox tables, as they at least have some form of multiuser record locking build in. Even then, you can get indexing problems with more than 3 - 4 users.

I'd strongly recommend an SQL database for proper multi-user systems. Try Firebird (free, open source version of Interbase) if money is limited. It will ensure that your system performs well and is very scalable.

You can use TTables with it, although I'd recommend TQuery. The learning curve is steeper but performance and scalability wins are much better.

Frank.

By: mnasman Date: 11/07/2003 01:26:00 English  Type : Comment
Hello Nick

You can put the dbf files in shared folder, and in each client you create map network drive for the shared drive for example z:\
and set the net drive to z:\, and create the BDE aliases to the map network

also careful that the DBGrid will cache the table to the client, and will not show the updated data till u refresh the table, so try to avoid using dbgrid when you have some clients accessing the same table, and just show the data needed in the DBGrid and not all the table

I don't know if i'm missing something because I haven't used BDE and paradox from long time

Best regards
Mohammed Nasman
By: mnasman Date: 11/07/2003 01:37:00 English  Type : Comment
here's a link from borland describe that better

<A HREF="http://community.borland.com/article/0,1410,15247,00.html">http://community.borland.com/article/0,1410,15247,00.html</a>

also I prefer to to more stable databases like : interbase OE, firebird or mysql and they are free, and working more better in network environment

I agree with Frank comment


By: swift99 Date: 11/07/2003 02:36:00 English  Type : Comment
I also agree with Frank's comment.
By: Ferruccio68 Date: 11/07/2003 04:50:00 English  Type : Assist
I'm working with BDE and Paradox tables on Lan (11 clients), and also with SyBase, Access and MySQL. Well, the hardest and more difficult was to make in working the BDE solution without too much indexing problem (unfortunatelly it was a huge old D3 project, too much time to convert it to MySql) .
So, i also absolutelly agree with Frank comment. Btw, if you want to stay in DBF solution so use BDE to have a minimal locking control as mnasman suggested.

F68 ;-)
By: VGR Date: 11/07/2003 17:01:00 English  Type : Assist
I'm French so I agree with everybody :D
By: ginsonic Date: 11/07/2003 17:42:00 English  Type : Comment
I'm interesting for mySql ( in fact I use it in my portals ). My problem is that I get two dbf files from another application ( not mine ).

One have ~450.000 of records with 12 columns each and one have 280 records with 10 columns each. This tables are updated monthly. Is possible to move dates from dbf to mySql and from mySql to dbf ( I need to report on floppy disk using a dbf file to another application, not mine) !?

In fact I care just for this big 450.000 records table ( it a list of people ).

My application count the services offer to some peoples from big dbf, store these dates and at end of the month get a report with name, kind of services and price into a dbf format.

Is the first database Lan application so I offer 2.000 points to guy/guys who can help me to finish this project ( the LAN database part ).


By: ginsonic Date: 11/07/2003 17:46:00 English  Type : Comment
HMM, how I see I must buy a license for mySql if I distribute my application with non open source software :(
By: ginsonic Date: 11/07/2003 17:51:00 English  Type : Comment
No problem to pay if I will sell couple applications, but untill then ... :)
440$ is my salary for 5 months.
By: ginsonic Date: 11/07/2003 18:09:00 English  Type : Comment
Me again :)

Thinking... I need just to accesss the big dbf from all client application and just to add independent records from each client.
No client can't modify records. This can be done just from application installed to server.

The clients just report to server what services was offered and who get these.
By: VGR Date: 11/07/2003 19:03:00 English  Type : Comment
ok, little misunderstanding here :

-you pay due royalties if you DISTRIBUTE MySql's (eventually modified) CODE in a sold application, not if you sell an application that USES MySql DB. That's applicable for all OpenSource stuff

-450 000 records is no match for the fast-n-powerful MySql

-PHP recognizes the DBF format (xBase), but I don't think MySql itself has direct tools to manipulate or translate those data files
By: ginsonic Date: 12/07/2003 02:05:00 English  Type : Comment
To access a mySQL database I don't need to have a licensed mySQL server installed ? For example, how I need BDE installed to access a dbf table.

Sorry if I ask stupid questions, but I like to respect the licenses of each library used in my applications. Sometimes I found sponsors that offer me a commercial license of their libraries, sometimes I use just freewares.
By: ginsonic Date: 12/07/2003 02:10:00 English  Type : Comment
But I return and repeate that I don't need to edit same record from 3-4 different systems.
Just what I need is to have read only access from different locations to same table, maybe same record, and to can insert (just to insert) new records.
The only one who can access the table to edit will be the administrator that will have a client that will let him to delete or modify records.

Nick

P.S. I found a source code project that let me to move dbf records to mySQL. For mySql2DBF I think that is very easy :)
By: VGR Date: 12/07/2003 02:22:00 English  Type : Comment
no you don't need a licensed mysql server to use mysql. You only need a mysql server.
By: ginsonic Date: 12/07/2003 16:37:00 English  Type : Comment
And if my client don't have a mySql server ?
By: VGR Date: 12/07/2003 16:58:00 English  Type : Comment
the client doesn't need any server, just a mysql client. They are distributed with the server but may be installed separately. This is if he wants a direct access to the DB (the simpliest being the "mysql console", ie "mysql" executable)

If he uses a browser-based system hosted on some web server, then he needs no additional software, the front-end language (ex. PHP) contains a client towards any MySql server.
By: ginsonic Date: 13/07/2003 05:21:00 English  Type : Comment
I still don't understand. Sorry but I'm just an amateur programmer :(

How I see the things:

Somewhere I have a server where I have my three tables. I have anothers four systems that use my client application ( NO BROWSER ). Each client contact my server and request some details about a pacient ( in my case ): name, address, disease hystory ... using the personal code. When I get some additional conclusions about the pacient visit reason I need to send to the server my diagnosis and my recommendation for this pacient to insert into another table where I record all services offered into that month.

At the end of month I need to print a report.


If I use just a mysql client where will conect it if I don't have a mySql server?
By: VGR Date: 13/07/2003 05:50:00 English  Type : Comment
ok. First of all, a browser interface is just the ***easiest*** way of solving your problem. This stated :

-you can install a custom client program, built in Delphi/VB/C/C++/whatever, and even just a BATch script using the DOS application named "mysql"
-your clients, unlimited in number, would just type in (or click on the shortcut to) "connectme" and they would be connected. Reading/writing data is no problem.
-you would have only one mysql server (free of all and any charges, fees and royalties) anywhere else as long as it's accessible via TCP/IP from the clients.

If you go for the "simple and dirty" BATch solution, I could recommend this kind of BAtch :
-takes the password from command line (so it has to be typed by the client)
-two versions, one for requesting data about a patient - name passed in parameter also
-the other one for writing back data to the server

very easy

the BATches would look like :
@echo off
mysql --user=genericuser --password=%1 --host=thehostname -e "select * from usertable where name like '%2';"
^Z



By: ginsonic Date: 14/07/2003 00:30:00 English  Type : Comment
OK. I will use mySQL. What components ( freeware please ) I must use to access my database ?
By: swift99 Date: 14/07/2003 01:09:00 English  Type : Answer
MySQL does not support transaction processing, which leads to probably data integrity issues in a distributed environment. When dealing with medical data, data loss would not be acceptable because someone could die from it, literally. In that case, you, as the programmer/architect of the system, could be part of a very expensive lawsuit. Firebird (open source Interbase) might be a better choice because it does have two phase commit transaction support. Like MySQL, it is free.

I know this wasn't your question, but here's some freebie advice from long painful experience.

For "personal code" in a distributed database environment, I recommend using a GUID. It is guaranteed unique around the world until the year 3040. IF you ever want to expand your schema, then this will eliminate 50% of the hurdles. Alternatively, separate the concept of personal code (user entered shortcut code) from the internally used identifier (GUID), so that different sites using the same personal code won't accidentally overwrite each other, and you can provide an admin tool for sorting out duplicate personal codes without data loss.

The other 50% will be handled by using an "insert only" paradigm, where user data is never updated or deleted, only inserted and invalidated. To do this, add an integer "sequence" and a DateTime "invalidated" to each table's definitions. Add "and (invalidated is null)" to the where clause of all of your normal applciation queries. The code can be implemented at a later date if the table structure supports it up front.

This gives you the foundation for an audit trail, which will save your *** if anyone gets sued (ask any former Enron programmer).

Store a GUID as CHAR (38), and sequence as 32 bit Integer.

The primary key for each table is the GIUD and the sequence. Another very good index would be GUID, sequence, and invalidated date.

By: ginsonic Date: 14/07/2003 01:48:00 English  Type : Comment
Thank for your advices swift99. Good to know that is probably to lose some dates :(

About personal code ( personal numeric code ) , in my country all people have an unique code that is registered in identity cards ( alike social code in US, not sure ) . So isn't a problem to identify a person using this code.
By: VGR Date: 14/07/2003 02:08:00 English  Type : Comment
you don't need any "freewares to access your database" :
-PHP has MySql support
-Delphi has MySql support [through 3rd party free tools or the libmysql.DLL], or via ADO, ODBC...
-VB also can use the libmysql.DLL, or ADO, ODBC...etc
By: swift99 Date: 14/07/2003 02:30:00 English  Type : Comment
Social code in US ... it is technically illegal for that number to be used for anything but income tax purposes. The laws have not been generally enforced, but privacy advocates are lobbying for a bill to start enforcing that old law.
By: VGR Date: 14/07/2003 02:57:00 English  Type : Comment
not that special. Nominative files and databases are also illegal here, except if they are declared and approved by the CNIL (law of 1978)
By: ginsonic Date: 14/07/2003 13:43:00 English  Type : Comment
In Romania is not a problem. In fact is the only way to be sure that we "talk" about same person.
By: ginsonic Date: 14/07/2003 13:44:00 English  Type : Comment
We can have a lots of John Doe that leave in same city on same street ... So we identify using this code.
By: ginsonic Date: 14/07/2003 13:47:00 English  Type : Comment
Sorry, wish to say 'live'.
By: swift99 Date: 15/07/2003 23:42:00 English  Type : Comment
No problem - I have a friend whose ex-wife chose to "leave" romania too :o)

I understand the problem with names fully - every place I work there are at least three people sharing my name.
By: ginsonic Date: 16/07/2003 00:24:00 English  Type : Comment
I will 'leave' soon :)
By: swift99 Date: 16/07/2003 00:26:00 English  Type : Comment
good luck!
By: ginsonic Date: 16/07/2003 00:50:00 English  Type : Comment
Thanks, I'm still in negotiations.
By: ginsonic Date: 16/07/2003 00:50:00 English  Type : Comment
BTW, I will close this question soon. I'll be back!
By: mnasman Date: 16/07/2003 20:17:00 English  Type : Assist
Hello

>>MySQL does not support transaction processing

Transactions
Using the InnoDB or Berkeley DB (BDB) storage engines, the MySQL database server supports transactions. The InnoDB storage engine also supports foreign key constraints.

in addition to ODBC and ADO, if you have Delphi 6 or 7, you can use dbExpress with MySql
also i think zeos library has support to MySql, and you can find some free components support it




By: ginsonic Date: 07/08/2003 00:37:00 English  Type : Comment
Thanks to all!

Do register to be able to answer

EContact
browser fav
page generated in 417.742010 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page