Browsear tablas MySQL

HMG en Español

Moderator: Rathinagiri

mincho73
Posts: 8
Joined: Sat Sep 13, 2008 12:13 am

Browsear tablas MySQL

Post by mincho73 »

Hola gente necesito saber si se puede hacer un browse sobre una tabla al viejo estilo como se hace con una dbf.

En un sistema tengo unas .dbf que muestro medienta la clase Browse, a dicho archivo .dbf lo acceden varios usuarios (por lo menos 10) al navegar por dicha tabla los usuarios van viendo los cambios que se van sucediendo en la medida que cada uno accede a los datos y los modifica.

Voy a migrar dicho sistema de .dbf's a una base de datos MySQL o PostGre.

Necesito saber si con una base de datos se pueden hacer browses como hago actualmente sobre las .dbf's

Muchas Gracias
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Browsear tablas MySQL

Post by Rathinagiri »

By Google Translator:
Hi folks need to know if you can do a browse on a table in the old style as with a dbf.

In a system I have a. Dbf I show the class medienta Browse to the file. Dbf multiple users access it (at least 10) to go through this table, users will see the changes that are happening to the extent that each accesses and modifies data.

I'll migrate the system. Dbf's to a database MySQL or Postgres.

I need to know if a database can do as I do now browses on. Dbf's
I think there is one RDD called SQLRDD for treating MySQL tables as dbf tables.

However, IMHO, both file oriented and server oriented database management systems are basically different. When you pass on a select query it gives the result as a table. That can be shown in a grid control. But, if you want to modify the data, we have to send another query to the server to effect the modification. SQLRDD wraps this up and lets you do it just like a dbf table.

From google translation:

Creo que hay una llamada SQLRDD RDD para el tratamiento de tablas MySQL como tablas dbf.

Sin embargo, en mi humilde opinión, tanto el archivo y el servidor orientado a los sistemas orientados a la gestión de bases de datos son básicamente diferentes. Cuando se pasa en una consulta de selección que da el resultado como una tabla. Eso puede ser mostrado en un control de cuadrícula. Pero, si desea modificar los datos, tenemos que enviar otra consulta al servidor para efectuar la modificación. SQLRDD envuelve esto y le permite hacerlo al igual que una tabla dbf.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
mincho73
Posts: 8
Joined: Sat Sep 13, 2008 12:13 am

Re: Browsear tablas MySQL

Post by mincho73 »

Ok. muchas gracias por el dato lo tendré en cuenta
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Browsear tablas MySQL

Post by esgici »

Hola Mincho
necesito saber si se puede hacer un browse sobre una tabla al viejo estilo como se hace con una dbf.
need to know if you can do a browse on a table in the old style as with a dbf.
I'm interested only your first question and my answer is "yes".

When that "db servers" didn't born (even only as a term), the old style .dbfs was exists and thousand of multiuser applications based tables in .dbf standards was run ;)

The synopsis of a browse in multiuser environment is quite simple :

- In that environment it's the best way USE'ing tables in shared mode ( except some specific process ).

- Use CURSOR (Current Set Of Record) whenever possible. While building that intermediate (scratch) file, LOCK included records in master table and UNLOCK when browse seance end. With this method, only one user can edit one or set of records, and modifications will come to scene only after editing process completed and saved to their original positions.

- If you don't use CURSOR and you want every user will see on the fly every modification:
-- use entire table for browse
-- LOCK every record before user begin editing it
-- UNLOCK locked record and COMMIT it after editing completed.

That is all.

If your only goal is browsing in multiuser environment, surely you don't need changing your database system :)

Happy Clipper'ing by HMG way :D

Saludos

--

Esgici



In that way user can't
Viva INTERNATIONAL HMG :D
mincho73
Posts: 8
Joined: Sat Sep 13, 2008 12:13 am

Re: Browsear tablas MySQL

Post by mincho73 »

Esgici Hello, I understand what you say.

No I just need to navigate in the table but also modify
And it's a system that is networked, with at least 10 more users accessing the same table at the same time.

As I understand it with the SELECT database brings me a snapshot of the table for me available.

I'm never working directly on the table as he did with the dbf's

Currently a user who travels in one browse the dbf instantly see the changes other users did
When you refresh the browser.

I want to do or imitate that same vision that I generated using the table.

Needless to say I aspire not to have to change much the source of my systems.

I have not so lucky ...

Thanks for your comment

In Clipper is all so easy ...
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: Browsear tablas MySQL

Post by l3whmg »

Hi Mincho73,
I'm not a guru, but I've done simple experience with MySql and PostGres.

Is my opinion you can browse the tables of these Databases (but you can use the same concept about .dbf tables) using GRID control and then edit record.

Normally, I load datas into the GRID (using SELECT clause without any lock option), browse data with GRID control and then select a row (using select clause with lock option) and edit the specified record. NB I write about lock, but I have find solution only with PostGres not with MySql.

I have get problem with SQLRDD perhaps because I don't understand very well it's use.

I hope, I give you a good way to solve your problem.

I'm sorry I can read/understand (little) your idioma but I can't write.

Best regards
Luigi from Italy
www.L3W.it
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Browsear tablas MySQL

Post by Rathinagiri »

Hi Luigi,

Can you supplement your idea by giving a small working sample?

Thanks.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
mincho73
Posts: 8
Joined: Sat Sep 13, 2008 12:13 am

Re: Browsear tablas MySQL

Post by mincho73 »

Thanks Luigi, I speak Spanish and use Google translator to write these messages.

Your idea seems very good and was something I had in mind.

Anyway I think the solution is in the RDDSQL.

From what I have read so far RDDSQL is achieved by connecting to the database and then use would be quite similar to the use that was given to. Dbf even commands work (not all)

With RDDSQL very little need to modify source code and achieves practically the same result

I think that road is the solution.

Thanks for your answer
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: Browsear tablas MySQL

Post by l3whmg »

Hi friends,

for Mincho: yes I think it's a good way but I don't use it. I will test. Any way, both dbf or postgresql I don't use BROWSE to edit record for many reason.

for Rathi
about your request I've upload a simple demostration with PostgreSql.

1) I'm using PostgreSql8.4.4 version
2) This program is intended to dimostrate my solution not for production

To run this demo you must
- create one database (I've used: tablespace=pg_default character=UTF8 Collation=C)
- grant privileges (about this database) to one user for: create table, append, delete, etc.
- modify line 94 in the main.prg with your values:

Code: Select all

LOCAL cServer := "xxx.xxx.xxx.xxx", cUserName := "userlogin", cUserPwd := "userpassword", cDbName := "testdb", nPort := 5432
- you must have all .dll files loaded where you run program. They are:
comerr32.dll
gssapi32.dll
k5sprt32.dll
krb5_32.dll
libeay32.dll
libiconv-2.dll
libintl-8.dll
libpq.dll
ssleay32.dll

Use:
- Every time you run the program, it will try to connect. Showed message in any case.
- Every time you can "create" table and populate for demostration use.
- With Browse function you can:
- view loaded data (press Load button)
- edit a record (double click on row)
- add a record (double click on a empty row)
- With Edit form you can save or delete record

NB I've used a simple tecnicque to lock Edit form when a record is loaded. For this reason I've used a invisible label.

I am at your disposal for any clarification.

Best regards
Attachments
Source.zip
sources example
(13.21 KiB) Downloaded 508 times
Luigi from Italy
www.L3W.it
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Browsear tablas MySQL

Post by Rathinagiri »

Thanks a lot. I would check...
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
Post Reply