Nuevo AdoRDD (libre)

User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Athayde,

>
HB_AdoRddGetRecordset():Supports( adIndex )
returns .F.
why?
i'm using MYSQL 4.1
>

We don't know it :-)

http://www.w3schools.com/ado/met_rs_supports.asp

> you testing with what GDB?

Access and MySQL (www.freesql.org). Some users are testing with Microsoft SQL too
regards, saludos

Antonio Linares
www.fivetechsoft.com
athayde
Posts: 33
Joined: Wed May 09, 2007 6:44 pm

Post by athayde »

Antonio,

Why code the ADORDD.PRG in xharbour_cvs is different of your?
in xharbour_cvs supports firebird
are projects differents?

Regards
athayde
Posts: 33
Joined: Wed May 09, 2007 6:44 pm

Post by athayde »

but which is your version of MYSQL?

Thanks
athayde
Posts: 33
Joined: Wed May 09, 2007 6:44 pm

Post by athayde »

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
athayde
Posts: 33
Joined: Wed May 09, 2007 6:44 pm

Post by athayde »

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
athayde
Posts: 33
Joined: Wed May 09, 2007 6:44 pm

Post by athayde »

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
athayde
Posts: 33
Joined: Wed May 09, 2007 6:44 pm

Post by athayde »

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
athayde
Posts: 33
Joined: Wed May 09, 2007 6:44 pm

Post by athayde »

about LOCATE with AND or "OR"
ADO limitation
Note: This method does not support multi-column searches (AND or OR)

Regards
athayde
Posts: 33
Joined: Wed May 09, 2007 6:44 pm

Post by athayde »

Antonio,
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
function ADO_GETFIELDTYPE it stranger i can't compares with HB_FT_STRING

Regards[/code]
athayde
Posts: 33
Joined: Wed May 09, 2007 6:44 pm

Post by athayde »

Great,
see my modification for uses QUERYs differents, is possible?
athayde
Posts: 33
Joined: Wed May 09, 2007 6:44 pm

Post by athayde »

a Question:
DBRLOCK() only returns .T.?

Regards
athayde
Posts: 33
Joined: Wed May 09, 2007 6:44 pm

Post by athayde »

the adordd in xharbour CVS is the some project?
User avatar
Adolfo
Posts: 815
Joined: Tue Oct 11, 2005 11:57 am
Location: Chile
Contact:

Post by Adolfo »

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
;-) 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
User avatar
jose_murugosa
Posts: 943
Joined: Mon Feb 06, 2006 4:28 pm
Location: Uruguay
Contact:

Post by jose_murugosa »

La versión que obtenemos aquí sirven tanto para Harbour como para xHarbour, verdad?

Funciona con PostgreSQL?
Saludos/Regards,
José Murugosa
FWH + Harbour + Bcc7. Una seda!
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Adolfo,

Para comenzar es preferible que crees la base de datos con una utilidad como el Navicat. Luego prueba el ejemplo mysql1.prg que proporcionamos con ADORDD
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply