Nuevo AdoRDD (libre)
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
use mysql1.prg
USE test00 VIA "ADORDD" TABLE "ACCOUNTS" MYSQL ;
FROM "www.freesql.org" USER "myuser" PASSWORD "mypass"
INDEX ON FIRST TO X_FIRST
Browse()
not error, but not ordened
USE test00 VIA "ADORDD" TABLE "ACCOUNTS" MYSQL ;
FROM "www.freesql.org" USER "myuser" PASSWORD "mypass"
INDEX ON FIRST TO X_FIRST
Browse()
not error, but not ordened
stranger no?
with Mysql 4.1 functions perfectly
USE ceif VIA "ADORDD" TABLE "aplica" MYSQL ;
FROM "localhost" USER "root" PASSWORD "masterkey" ALIAS "aplica"
with Mysql 5.0.37 error:
Error ADODB.Recordset/16389 E_FAIL: OPEN Arguments: ( [ 1] = Type: C Val: aplic
a [ 2] = Type: O Val: { TOLEAUTO Object })
Error at ...: TOLEAUTO:OPEN(0) in Module: win32ole.prg
Called from : ADO_OPEN(273) in Module: ADORDD.PRG
Called from : DBUSEAREA(0) in Module:
Regards
with Mysql 4.1 functions perfectly
USE ceif VIA "ADORDD" TABLE "aplica" MYSQL ;
FROM "localhost" USER "root" PASSWORD "masterkey" ALIAS "aplica"
with Mysql 5.0.37 error:
Error ADODB.Recordset/16389 E_FAIL: OPEN Arguments: ( [ 1] = Type: C Val: aplic
a [ 2] = Type: O Val: { TOLEAUTO Object })
Error at ...: TOLEAUTO:OPEN(0) in Module: win32ole.prg
Called from : ADO_OPEN(273) in Module: ADORDD.PRG
Called from : DBUSEAREA(0) in Module:
Regards
the solution for this error is:
static function ADO_OPEN( nWA, aOpenInfo )
local aWAData := USRRDD_AREADATA( nWA )
local cName, aField, oError, nResult
local oRecordSet, nTotalFields, n
// When there is no ALIAS we will create new one using file name
if aOpenInfo[ UR_OI_ALIAS ] == nil
HB_FNAMESPLIT( aOpenInfo[ UR_OI_NAME ], , @cName )
aOpenInfo[ UR_OI_ALIAS ] := cName
endif
aWAData[ WA_CONNECTION ] = TOleAuto():New( "ADODB.Connection" )
aWAData[ WA_TABLENAME ] = s_cTableName
IF EMPTY(s_cQuery)
s_cQuery = "SELECT * FROM "
ENDIF
Regards
static function ADO_OPEN( nWA, aOpenInfo )
local aWAData := USRRDD_AREADATA( nWA )
local cName, aField, oError, nResult
local oRecordSet, nTotalFields, n
// When there is no ALIAS we will create new one using file name
if aOpenInfo[ UR_OI_ALIAS ] == nil
HB_FNAMESPLIT( aOpenInfo[ UR_OI_NAME ], , @cName )
aOpenInfo[ UR_OI_ALIAS ] := cName
endif
aWAData[ WA_CONNECTION ] = TOleAuto():New( "ADODB.Connection" )
aWAData[ WA_TABLENAME ] = s_cTableName
IF EMPTY(s_cQuery)
s_cQuery = "SELECT * FROM "
ENDIF
Regards
Antonio,
about query, i see another thing
in ADO_OPEN
IF aWAData[ WA_QUERY ]=="SELECT * FROM "
oRecordSet:Open( aWAData[ WA_QUERY ] + aWAData[ WA_TABLENAME ], aWAData[ WA_CONNECTION ] )
ELSE
oRecordSet:Open( aWAData[ WA_QUERY ], aWAData[ WA_CONNECTION ] )
ENDIF
but, when USE command, not open HB_AdoSetQuery( <cQuery> ) function when not have a Query, only open function if Query exist, then forever push the last query
EX:
SELE 0
USE ceif VIA "ADORDD" ALIAS "S" TABLE "s" MYSQL FROM "localhost" USER "root" PASSWORD "masterkey"
< the query is a SELECT * FROM S >
but, if open with Query
SELE 0
USE ceif VIA "ADORDD" ALIAS "ABC" TABLE "ABC" MYSQL FROM "localhost" USER "root" PASSWORD "masterkey" QUERY "SELECT * FROM ABC ORDER BY nomeus"
< the query is a SELECT * FROM ABC ORDER BY nomeus >
but if open without Query again
SELE 0
USE ceif VIA "ADORDD" ALIAS "TTT" TABLE "TTT" MYSQL FROM "localhost" USER "root" PASSWORD "masterkey"
< the query is a SELECT * FROM ABC ORDER BY nomeus >
not cleaning query when open new alias
Regards
about query, i see another thing
in ADO_OPEN
IF aWAData[ WA_QUERY ]=="SELECT * FROM "
oRecordSet:Open( aWAData[ WA_QUERY ] + aWAData[ WA_TABLENAME ], aWAData[ WA_CONNECTION ] )
ELSE
oRecordSet:Open( aWAData[ WA_QUERY ], aWAData[ WA_CONNECTION ] )
ENDIF
but, when USE command, not open HB_AdoSetQuery( <cQuery> ) function when not have a Query, only open function if Query exist, then forever push the last query
EX:
SELE 0
USE ceif VIA "ADORDD" ALIAS "S" TABLE "s" MYSQL FROM "localhost" USER "root" PASSWORD "masterkey"
< the query is a SELECT * FROM S >
but, if open with Query
SELE 0
USE ceif VIA "ADORDD" ALIAS "ABC" TABLE "ABC" MYSQL FROM "localhost" USER "root" PASSWORD "masterkey" QUERY "SELECT * FROM ABC ORDER BY nomeus"
< the query is a SELECT * FROM ABC ORDER BY nomeus >
but if open without Query again
SELE 0
USE ceif VIA "ADORDD" ALIAS "TTT" TABLE "TTT" MYSQL FROM "localhost" USER "root" PASSWORD "masterkey"
< the query is a SELECT * FROM ABC ORDER BY nomeus >
not cleaning query when open new alias
Regards
Antonio,
fix for return size correct
function ADO_GETFIELDTYPE it stranger i can't compares with HB_FT_STRING
Regards[/code]
fix for return size correct
Code: Select all
static function ADO_GETVALUE( nWA, nField, xValue )
local aWAData := USRRDD_AREADATA( nWA )
local oRecordSet := USRRDD_AREADATA( nWA )[ WA_RECORDSET ]
local lChar,nADOFieldType
if aWAData[ WA_EOF ] .or. oRecordSet:RecordCount() == 0
xValue := nil
else
xValue := oRecordSet:Fields( nField - 1 ):Value
nADOFieldType=oRecordSet:Fields( nField - 1 ):Type
lChar=.F.
IF nADOFieldType == adDBDate
lChar=.T.
ELSEIF nADOFieldType == adDBTime
lChar=.T.
ELSEIF nADOFieldType == adDBTimeStamp
lChar=.T.
ELSEIF nADOFieldType == adBSTR
lChar=.T.
ELSEIF nADOFieldType == adChar
lChar=.T.
ELSEIF nADOFieldType == adVarChar
lChar=.T.
ELSEIF nADOFieldType == adLongVarChar
lChar=.T.
ELSEIF nADOFieldType == adWChar
lChar=.T.
ELSEIF nADOFieldType == adVarWChar
lChar=.T.
ENDIF
IF lChar
xValue := xValue+SPACE( oRecordSet:Fields( nField - 1 ):DefinedSize - LEN(xValue) )
ENDIF
endif
return SUCCESS
Regards[/code]
Fernando y/o Antonio
Estoy inicando las pruebas con Mysql 5 y tengo lo siguiente:
Poseo el nombre de usuario y clave del root
Mysql corriendo localmente ( en 127.0.0.1 localhost )
Quisiera poder
1.- Conectarme al Servidor Mysql
2.- Crear una Base de datos
3.- Crear las tablas
Cualquier ayuda bienvenida sera... y si me funciona mi "invento" lo compartire con UDS.
Desde Chile
Adolfo
Estoy inicando las pruebas con Mysql 5 y tengo lo siguiente:
Poseo el nombre de usuario y clave del root
Mysql corriendo localmente ( en 127.0.0.1 localhost )
Quisiera poder
1.- Conectarme al Servidor Mysql
2.- Crear una Base de datos
3.- Crear las tablas
Cualquier ayuda bienvenida sera... y si me funciona mi "invento" lo compartire con UDS.
Desde Chile
Adolfo
Ji,ji,ji... buena la cosa... "all you need is code"
http://www.xdata.cl - Desarrollo Inteligente
----------
Lenovo Legion Y520, 16GB Ram, 1 TB NVME M.2, 1 TB SSD, GTX 1050
http://www.xdata.cl - Desarrollo Inteligente
----------
Lenovo Legion Y520, 16GB Ram, 1 TB NVME M.2, 1 TB SSD, GTX 1050
- jose_murugosa
- Posts: 943
- Joined: Mon Feb 06, 2006 4:28 pm
- Location: Uruguay
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact: