Long ago I required a little help with windows

Moderator: Rathinagiri

martingz
Posts: 394
Joined: Wed Nov 18, 2009 11:14 pm
Location: Mexico

Re: Long ago I required a little help with windows

Post by martingz »

Juan Carlos
1. El servidor de mysql lo tenemos en un web host
2.- te puedes conectar desde cualquier parte que tenga internet
3.- Claro que si subire loa fuentes en cuanto este terminado, el codigo esta muy sucio hay que depurarlo ( esto por la premura de que el cliente lo requiere ya , y a que es mi primer intento con mysql)

saludos

Google tanslation

Juan Carlos
1. El servidor de mysql lo tenemos en un servidor publico
2.- te puedes conectar desde cualquier parte que tenga internet
3.- Subire los fuentes en cuanto este terminado, el codigo esta muy sucio hay que depurarlo ( esto por la premura de que el cliente lo requiere ya , y a que es mi primer intento con mysql)

regards
jucar_es
Posts: 82
Joined: Thu Nov 13, 2008 11:12 pm

Re: Long ago I required a little help with windows

Post by jucar_es »

Gracias martin

En verdad he quedado con la espinita ....

siempre he querido realizar una aplicacion de ese tipo
despues de 20 años de programar con dbf... ahora debo incursionar en esta tecnologia

siempre he sido autodidacta y no he podido comprender la filosfia de mysql

talvez mirando con su ejemplo pueda por fin lograr una aplicacion que se conecte wia web
como la suya

no se preocupe por los detalles solo requiero ver

conexion, creacion y actualizacion de registros en la base de datos

quedo en espera de su valioza colaboracion
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: Long ago I required a little help with windows

Post by Rathinagiri »

Using HMGMySQL library it is very easy. For more details please see this thread:

http://hmgforum.com/viewtopic.php?f=8&t=1562

There are four functions in this library.

Connect2DB() -> oDBO

This is used to connect to the RDBMS database. This function returns the DataBase Connection Object which can be used in all other SQL activities.

Syntax: Connect2DB(cHost,cUser,cPassword,cDBname).

Example:

Code: Select all

dbo := connect2db('localhost','user1','pass1','productdb')

SQL(oDBO,cQStr) –> aTable - This is used to execute only the “SELECT” type queries. This function returns a two dimensional array of the query result (even though the resultant number of rows and columns be 1). An empty array will be returned in case there are no rows returned.

Example:

Code: Select all

aTable := SQL(dbo,”select * from products order by name”)
MiscSQL(oDBO,cQStr) -> lOk – This is used to execute all the other miscellaneous commands like “Insert, Delete, Update, Create, Alter, Grant” etc., except “Select”. This function returns a logical value. If the query execution was successful, .t. is returned. Otherwise .f. is returned.

Example:

Code: Select all

lOk := MiscSQL(dbo,”insert into products values (1,'Product1')”)
C2SQL(xValue) -> xValue – This function is used to parse the values to be SQL safe which can be used in any query in-line. This function returns the parsed value of the value passed.

Example:

Code: Select all

aTable := SQL(dbo,”select * from ledger where date <= “+c2sql(date()))
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
Leopoldo Blancas
Posts: 388
Joined: Wed Nov 21, 2012 7:14 pm
Location: México

Re: Long ago I required a little help with windows

Post by Leopoldo Blancas »

Hola Rathinagiri...

Yo voy a empezar a estudiar lo de HMGMySQL, que parece que esa es la tendencia.... Gracias por compartir.

Saludos
Polo
*-------------------------------------------------------------------------------------------------------------------
Hello Rathinagiri ...

I'm going to start studying it in HMGMySQL, it looks like that's the trend .... Thanks for sharing.

regards
Polo
jucar_es
Posts: 82
Joined: Thu Nov 13, 2008 11:12 pm

Re: Long ago I required a little help with windows

Post by jucar_es »

Gracias Rathinagiri


mis respetos para ud...

ya he relizado pruebas de conexion... y he mirado muchos de sus grandes ejemplos

ya he creado e , insertado registros

no se como hacer para modificar de un registro ya existente solo un campo

por ejemplo

cambiar el campo nombre con valor " campo 1" por valor "campo 1 MODIFICADO"

y que los demas campos sigan con sus valores

he mirado muchos ejemplos en postgresql, mysql, etc y no he dado... puede usted enseñarme como..
gracias
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: Long ago I required a little help with windows

Post by andyglezl »

Hola, estoy haciendo una prueba con lo de MySql,
despues de compilar, me despliega este error.
De donde tomo esta .dll ??
-----------------------------------------------
Hello, I'm doing a test with MySQL
After compiling, I displayed this error.
From where I take this. Dll??
Attachments
Sin título-2.png
Sin título-2.png (26.77 KiB) Viewed 9447 times
Andrés González López
Desde Guadalajara, Jalisco. México.
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: Long ago I required a little help with windows

Post by Rathinagiri »

Yes, you require at runtime this dll file. libmysql.dll should be placed either in the application directory or in windows system directory.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: Long ago I required a little help with windows

Post by andyglezl »

Gracias Rathinagiri

Copie la DLL al directorio de mi aplicacion pero me siguio
dando errores, busque en Internet y me encontre
con esta. http://es.dll-files.com/libmysql.dll.html
Ya no tengo los errores anteriores, ahora son de sintaxis.
Sigo probando. . .
---------------------------------------------------------
Thanks Rathinagiri

Copy the DLL to the directory of my application but I followed
giving errors, search the Internet and I found
with this. [url] http://es.dll-files.com/libmysql.dll.html [/ url]
I have no previous errors, syntax now.
I keep trying. . .
Andrés González López
Desde Guadalajara, Jalisco. México.
martingz
Posts: 394
Joined: Wed Nov 18, 2009 11:14 pm
Location: Mexico

Re: Long ago I required a little help with windows

Post by martingz »

Juan Carlos
Leopoldo
Andres
Envio una aplicacion que podran ver como conectar al servidor de mysql, y su uso de inserts y update muy basicos pero suficiente para comenzar, lo del restaurant lo subire despues, gracias a algunos movimientos que hicieron nos dimos cuenta de unos pequeños detalles y estamos trabajando en ellos para poder entregar a tiempo la aplicacion

Nota, al compilar el proyecto, seguramente veran que cuando entran a la opcion de articulos, esta tarda demasiado y tiene un parpadeo molesto, esto lo medio soluciono con un truco que no se si sera lo mejor, pero trdo bastante menos tiempo, y no muestra el parpadeo.

en la linea 547 de h_grid.prg

*_HMG_DOGRIDREFRESH(I)
la cometamos para que no se compile, reconstruimos la libreria y listo, claro que despues de eso, tenemnos que poner manualmente un refres al grid en nuestros programas.

saludos


Google Translation
I send an application that will see how to connect to mysql server, and use of inserts and update very basic but enough to start, so I'll upload the restaurant later, thanks to some moves that did we realized a few details and are working on them to deliver on time the application

Note, when you compile the project, I will see that when they come to the choice of articles, this takes too long and has an annoying flicker, this half fix it with a trick that is not the best, but it took far less time, and
shows no flicker.

on line 547 of h_grid.prg

* _HMG_DOGRIDREFRESH (I)
the commit to not compile, rebuilt the library and ready, of course after that, we have to manually refresh the grid in our programs.

regards
Attachments
MyPos.zip
(944.85 KiB) Downloaded 385 times
Post Reply