HMG 3.0 (Test XII)
Moderator: Rathinagiri
Re: HMG 3.0 (Test XII)
I wanna post report and dbf, where I have problem with polish characters.
- Attachments
-
- report_pl_chars.zip
- (1.77 KiB) Downloaded 299 times
Re: HMG 3.0 (Test XII)
I don't know how to link all my informations for working app.Roberto Lopez wrote:Via ODBC, but, you should install MySql ODBC client (I guess that there is no licensing problems with it).mol wrote:I have a question:
How to connect to MySQL database without mysql.lib when ADO is removed from harbour?
For a sample of ODBC usage, please look at \hmg\samples\rdd.sql\mdb.
When I connect to MySQL database via ODBC, I get connection, but, after, when I send request to database, I get error:
Error SDDODBC/1902 Invalid field type: SELECT * FROM country (DOS Error 65528)
Called from DBUSEAREA(0)
CALLED FROM MAIN(43)
Code: Select all
odp := RDDINFO( RDDI_CONNECT,;
{ "ODBC", "DBQ=" +"Server=localhost;Driver={MySQL ODBC 5.1 Driver};dsn=;User=root;password=123;database=korespondencja;Option=3;"} )
if odp = 0
//not connected
return
endif
// it's required to use record locking to set autocommit to 0!!!!
RDDINFO(RDDI_EXECUTE,"SET AUTOCOMMIT = 0")
DBUSEAREA( .T.,, "SELECT * FROM country", "country" )
Marek
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: HMG 3.0 (Test XII)
Thanks Marek. I'll try to catch the problem.mol wrote:I wanna post report and dbf, where I have problem with polish characters.
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: HMG 3.0 (Test XII)
I've not attempted to use MySql via ODBC yet (I've just pointed that it could be possible) so, I have not info right now to help you on that.mol wrote:I don't know how to link all my informations for working app.Roberto Lopez wrote:Via ODBC, but, you should install MySql ODBC client (I guess that there is no licensing problems with it).mol wrote:I have a question:
How to connect to MySQL database without mysql.lib when ADO is removed from harbour?
For a sample of ODBC usage, please look at \hmg\samples\rdd.sql\mdb.
When I connect to MySQL database via ODBC, I get connection, but, after, when I send request to database, I get error:Error SDDODBC/1902 Invalid field type: SELECT * FROM country (DOS Error 65528)
Called from DBUSEAREA(0)
CALLED FROM MAIN(43)I can place all sample if sb. want to access to test it.Code: Select all
odp := RDDINFO( RDDI_CONNECT,; { "ODBC", "DBQ=" +"Server=localhost;Driver={MySQL ODBC 5.1 Driver};dsn=;User=root;password=123;database=korespondencja;Option=3;"} ) if odp = 0 //not connected return endif // it's required to use record locking to set autocommit to 0!!!! RDDINFO(RDDI_EXECUTE,"SET AUTOCOMMIT = 0") DBUSEAREA( .T.,, "SELECT * FROM country", "country" )
Marek
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
Re: HMG 3.0 (Test XII)
Connecting to database, inserting rows works OK. But I can't retrieve data by select...
Don't you know Roberto, where to find more info about RDDSQL?
I can't find anything with google.
I've tried to write to Przemek Czerpak, but, I think, I have bad address.
Best regards, Marek
Don't you know Roberto, where to find more info about RDDSQL?
I can't find anything with google.
I've tried to write to Przemek Czerpak, but, I think, I have bad address.
Best regards, Marek
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: HMG 3.0 (Test XII)
RDDSQL author is Mindaugas Kavaliauskas <dbtopas at dbtopas.lt>mol wrote:Connecting to database, inserting rows works OK. But I can't retrieve data by select...
Don't you know Roberto, where to find more info about RDDSQL?
I can't find anything with google.
I've tried to write to Przemek Czerpak, but, I think, I have bad address.
Best regards, Marek
Here is the library source code and samples from Harbour sources.
- Attachments
-
- rddsql.rar
- (54.95 KiB) Downloaded 332 times
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
Re: HMG 3.0 (Test XII)
I've written to him, but he couldn't help me.
I think, I will leave this topic.
I think, it must be a little bug in RDDSQL.
Regards, Marek
I think, I will leave this topic.
I think, it must be a little bug in RDDSQL.
Regards, Marek
Re: HMG 3.0 (Test XII)
I've made some tests and found, that RDDSQL with MySQL and ODBC have problem with CHAR, VARCHAR or TEXT fields.
I'm writing with Mindaugas Kavaliauskas <dbtopas at dbtopas.lt> about this problem.
I'll inform you about results.
I'm very interesting to make working example with Mysql, RDDSQL and ODBC with record locking.
Best regards, Marek
I'm writing with Mindaugas Kavaliauskas <dbtopas at dbtopas.lt> about this problem.
I'll inform you about results.
I'm very interesting to make working example with Mysql, RDDSQL and ODBC with record locking.
Best regards, Marek
Re: HMG 3.0 (Test XII)
Hello Marek,mol wrote:I've made some tests and found, that RDDSQL with MySQL and ODBC have problem with CHAR, VARCHAR or TEXT fields.
I'm writing with Mindaugas Kavaliauskas <dbtopas at dbtopas.lt> about this problem.
I'll inform you about results.
I'm very interesting to make working example with Mysql, RDDSQL and ODBC with record locking.
I was able to connect and select data from mysql table by RDDSQL and mysql ODBC connector 3.51.
Take a look for the working sample below:
Code: Select all
/*
* MINIGUI - Harbour Win32 GUI library Demo
*
* Copyright 2002-2009 Roberto Lopez <harbourminigui@gmail.com>
* http://harbourminigui.googlepages.com/
*
* Copyright 2009 Grigory Filatov <gfilatov@freemail.ru>
*
* Based on RDDSQL ODBC sample included in Harbour distribution
*/
#include "minigui.ch"
#include "dbinfo.ch"
#include "error.ch"
#define RDDI_CONNECT 1001
#define RDDI_DISCONNECT 1002
#define RDDI_EXECUTE 1003
ANNOUNCE RDDSYS
REQUEST SQLMIX, SDDODBC
*--------------------------------------------------------*
Function Main()
*--------------------------------------------------------*
LOCAL nConnection
RDDSETDEFAULT( "SQLMIX" )
SET( _SET_DATEFORMAT, "yyyy-mm-dd" )
nConnection := RDDINFO( RDDI_CONNECT, { "ODBC", "Server=localhost;Driver={MySQL ODBC 3.51 Driver};dsn=;User=root;database=test;" } )
IF nConnection == 0
MsgStop("Unable connect to the server!", "Error")
Return nil
ENDIF
DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 640 HEIGHT 480 ;
TITLE 'MiniGUI ODBC Database Driver Demo' ;
MAIN NOMAXIMIZE ;
ON INIT OpenTable() ;
ON RELEASE CloseTable()
DEFINE MAIN MENU
DEFINE POPUP 'File'
ITEM "Exit" ACTION ThisWindow.Release()
END POPUP
END MENU
@ 10,10 BROWSE Browse_1 ;
WIDTH 610 ;
HEIGHT 390 ;
HEADERS { 'Code' , 'Name' , 'Residents' } ;
WIDTHS { 50 , 160 , 100 } ;
WORKAREA country ;
FIELDS { 'country->Code' , 'country->Name' , 'country->Residents' } ;
JUSTIFY { BROWSE_JTFY_LEFT, BROWSE_JTFY_LEFT, BROWSE_JTFY_RIGHT }
END WINDOW
CENTER WINDOW Form_1
ACTIVATE WINDOW Form_1
Return nil
*--------------------------------------------------------*
Procedure OpenTable
*--------------------------------------------------------*
If CreateTable()
DBUSEAREA( .T.,, "SELECT * FROM country", "country" )
INDEX ON FIELD->RESIDENTS TAG residents TO country
GO TOP
Else
Form_1.Release()
EndIf
Return
*--------------------------------------------------------*
Procedure CloseTable
*--------------------------------------------------------*
DBCLOSEALL()
Return
*--------------------------------------------------------*
Function CreateTable
*--------------------------------------------------------*
Local ret := .T.
RDDINFO(RDDI_EXECUTE, "DROP TABLE country")
If RDDINFO(RDDI_EXECUTE, "CREATE TABLE country (CODE char(3), NAME char(50), RESIDENTS int(11))")
If ! RDDINFO(RDDI_EXECUTE, "INSERT INTO country values ('LTU', 'Lithuania', 3369600), ('USA', 'United States of America', 305397000), ('POR', 'Portugal', 10617600), ('POL', 'Poland', 38115967), ('AUS', 'Australia', 21446187), ('FRA', 'France', 64473140), ('RUS', 'Russia', 141900000)")
MsgStop("Can't fill table Country!", "Error")
ret := .F.
EndIf
Else
MsgStop("Can't create table Country!", "Error")
ret := .F.
EndIf
Return ret
Kind Regards,
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
Re: HMG 3.0 (Test XII)
En Español.
Hola Roberto.
Mi pregunta es si esta versión de HMG 3.0 es fiable para trabajar con ella, o debo seguir usando HMG 2.9.5. Usted sabe que estoy comenzando a programar en HMG y no soy muy habilidoso que digamos.
Saludos cordiales.
Rafael Pérez
In English.
Hello Roberto.
My question is whether this version of HMG 3.0 is reliable to work with it, or should I keep using 2.9.5 HMG. You know I'm starting to program in HMG and I'm not very clever to say.
Best regards.
Rafael Perez
Hola Roberto.
Mi pregunta es si esta versión de HMG 3.0 es fiable para trabajar con ella, o debo seguir usando HMG 2.9.5. Usted sabe que estoy comenzando a programar en HMG y no soy muy habilidoso que digamos.
Saludos cordiales.
Rafael Pérez
In English.
Hello Roberto.
My question is whether this version of HMG 3.0 is reliable to work with it, or should I keep using 2.9.5 HMG. You know I'm starting to program in HMG and I'm not very clever to say.
Best regards.
Rafael Perez