Page 2 of 2

Re: Long ago I required a little help with windows

Posted: Thu Mar 14, 2013 8:15 pm
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

Re: Long ago I required a little help with windows

Posted: Fri Mar 15, 2013 2:10 pm
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

Re: Long ago I required a little help with windows

Posted: Fri Mar 15, 2013 2:21 pm
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()))

Re: Long ago I required a little help with windows

Posted: Fri Mar 15, 2013 5:29 pm
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

Re: Long ago I required a little help with windows

Posted: Fri Mar 15, 2013 7:25 pm
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

Re: Long ago I required a little help with windows

Posted: Sat Mar 16, 2013 1:19 am
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??

Re: Long ago I required a little help with windows

Posted: Sat Mar 16, 2013 2:42 am
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.

Re: Long ago I required a little help with windows

Posted: Sat Mar 16, 2013 3:42 am
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. . .

Re: Long ago I required a little help with windows

Posted: Sat Mar 16, 2013 6:01 pm
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