ADO RDD xHarbour

Re: ADO RDD xHarbour

Postby AHF » Wed May 20, 2015 7:42 am

Lucas,

oRecordSet:Update( nField - 1, IfNil( xValue, AdoNull() ) )


Im going to try it.
The date errors only happens (MySql) when you edit a empty date and save the same empty date.
Thats why we didnt have found it before although the app makes lot of transactions but never in this circumstance.
When the user in a browse does that errors.

I know that expressions with numbers in SCOPES and perhaps INDEX mail fail. Fortunatly we dont have such cases in the app. Ill give it a look asap.
The app we are working doesnt have SCOPES so its done but never tried.
Can you post an example based on your trial tables?

Our client wants the filters as they have with ADS. They are lightning fast thus we have to do it that way.
Filters we will convert it for now to Mysql expressions only.

About record size we dont have the error here. We have tables with more than 60 fields.
Ive try it already with Mysql and Access.
What is the record size causing your problem?
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby lucasdebeltran » Wed May 20, 2015 8:08 am

Antonio,

What is your email to send the database?.

The database has some fields with 80 or more chars.

About scopes, try to do

SET SCOPE TO ID = 10
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: ADO RDD xHarbour

Postby AHF » Wed May 20, 2015 8:20 am

Lucas,

I tried your code last post.
Result is the same if I edit a field date in browse() with an empty date and make enter with empty date errors.
If I do the same but enter a date ok
If I do the same and clean that date ok

disal.antonio.ferreira at gmail.com

Ill try scopes asap
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby AHF » Wed May 20, 2015 8:24 am

Lucas,

The database has some fields with 80 or more chars.


Ours some fields with 200 chars.

Can you check exact recsize()
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby lucasdebeltran » Wed May 20, 2015 8:31 am

Yes, returns 6763.

Thanks.
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: ADO RDD xHarbour

Postby AHF » Wed May 20, 2015 8:50 am

Lucas,

Thanks Ill try it.

About dates the only way it works with access and mysql is placing in ADO_PUTVALUE :

Code: Select all  Expand view  RUN

IF ADO_FIELDSTRUCT( oRecordSet, nField-1 )[2] $ "DT" .AND. (EMPTY(xValue) .OR. FW_TTOD( xValue ) == {^ 1899/12/30 })

   xValue := 0

ENDIF
 



But Ill get back to the problem that the date field stays with 31/12/1899.
SQL dates support dates from 01/01/1900 on maybe thats why blank dates are 31.12.1899 23:59:59

Im trying in ADO_GETVALUE() to return a empty date in this condition otherwise this doesnt work for me.

Can you try it there and confirm?
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby AHF » Wed May 20, 2015 10:53 am

Lucas,

I think dates problem its solved. (Access Mysql oledb ADS)

Ive found out that when the field date is empty the fields:value type its "U" and can not be accessed in this state.
When we entered a field date empty and issue update with nothing it errors saying MEMBERNOTFOUND

Ill end you new version during today.
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby lucasdebeltran » Wed May 20, 2015 11:11 am

Antonio,

SET SCOPE fix seems to be:

STATIC FUNCTION ADOSCOPE(nWA,aWAdata, oRecordSet, aOrderInfo,nIndex)

IF LEN(ALLTRIM( cvaltochar(aWAData[ WA_SCOPETOP ][y]) + cvaltochar(aWAData[ WA_SCOPEBOT ][y])) ) > 0

Scopetop and ScopeBot can be a numeric.


Fields names greater that 8 chars fail.


Also, in DbCreate() I will add the following feature. In ADOSTRUCTTOSQL( aWAData,aStruct ,lAddAutoInc) I will check if aStruct has the default ID Autoincrement field, usually called HBRECNO. If there is no autoincrement "+" field, I will add to the array:

aAdd( aStruct, { "HBRECNO", "+", 15, 0 } )


Thanks.
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: ADO RDD xHarbour

Postby AHF » Wed May 20, 2015 11:24 am

Lucas,

Im looking at SET SCOPE and SET FILTER.

Fields names greater that 8 chars fail.


Where at scopes? Filedname() returns the :field:name

Can you try fieldname() function?
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby AHF » Wed May 20, 2015 11:26 am

Lucas,

Also, in DbCreate() I will add the following feature. In ADOSTRUCTTOSQL( aWAData,aStruct ,lAddAutoInc) I will check if aStruct has the default ID Autoincrement field, usually called HBRECNO. If there is no autoincrement "+" field, I will add to the array:

aAdd( aStruct, { "HBRECNO", "+", 15, 0 }


Good idea! Please post your change here.
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby lucasdebeltran » Wed May 20, 2015 11:32 am

Antonio,

Code: Select all  Expand view  RUN


STATIC FUNCTION ADOSTRUCTTOSQL( aWAData,aStruct ,lAddAutoInc)

 LOCAL cSql := "", nCol
 LOCAL oCn := aWAData[ WA_CONNECTION ]
 LOCAL dbEngine := aWAData[ WA_ENGINE ], nver :=0
 LOCAL aEngines := { "DBASE","ACCESS","MSSQL","MYSQL","ORACLE","SQLITE",;
                     "FOXPRO","POSTGRE","INFORMIX","ANYWHERE","ADS"}
 LOCAL snDbms := ASCAN(aEngines,dbEngine),c


 if AScan( aStruct , "HBRECNO" )  = 0
    aAdd( aStruct, { "HBRECNO", "+",  15,   0 } )
 endif



 
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: ADO RDD xHarbour

Postby AHF » Wed May 20, 2015 11:50 am

Lucas,

Thanks.

About fieldname we are limited to 10 chars long not 8
This its (x)Harbour limitation. adordd simply returns :field:name but then usrrdd cuts it to 10 chars long.

For us no problem is it for you? Although this is a huge limitation in SQL.

We need Antonio to help us solve this limitation.
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby lucasdebeltran » Wed May 20, 2015 1:19 pm

Antonio,

aWAData[ WA_SCOPETOP ][y] and aWAData[ WA_SCOPEBOT ][y] seems that are SCOPE´s values.

You are issuing LEN(ALLTRIM( ..., but those Scope values could be a number, or a date, so that´s why it fails.
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: ADO RDD xHarbour

Postby AHF » Wed May 20, 2015 1:47 pm

Lucas,

We can use

Code: Select all  Expand view  RUN
IF !EMPTY(aWAData[ WA_SCOPETOP ][y]) .OR. !EMPTY(aWAData[ WA_SCOPEBOT ][y])


Can you try it?
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby AHF » Wed May 20, 2015 1:56 pm

Lucas,

There another bug in adoscope.

Please replace with this code: (note the 2 commented aadd)

Code: Select all  Expand view  RUN

 CASE nIndex == DBOI_SCOPETOP

        IF y > 0
           aOrderInfo[ UR_ORI_RESULT ] := aWAData[ WA_SCOPETOP ][y] //RETURN ACTUALSCOPE TOP
           aWAData[ WA_SCOPETOP ][y] := aOrderInfo[ UR_ORI_NEWVAL ]
           IF LEN(aWAData[ WA_SCOPEBOT ]) < y
              AADD(aWAData[ WA_SCOPEBOT ],SPACE(LEN(CVALTOCHAR(aWAData[ WA_SCOPETOP ][y])))) //THERE INST STILL A SCOPEBOT ARRAYS MUST HAVE  SAME LEN
           ENDIF     
        ELSE
           AADD(aWAData[ WA_SCOPETOP ],aOrderInfo[ UR_ORI_NEWVAL ])
           //AADD(aWAData[ WA_SCOPEBOT ],SPACE(LEN(CVALTOCHAR(aWAData[ WA_SCOPETOP ][1])))) //THERE INST STILL A SCOPEBOT ARRAYS MUST HAVE  SAME LEN
           aOrderInfo[ UR_ORI_RESULT ] := ""
        ENDIF      
     
   CASE nIndex == DBOI_SCOPEBOTTOM

        IF y > 0
           aOrderInfo[ UR_ORI_RESULT ] := aWAData[ WA_SCOPEBOT ][y] //RETURN ACTUALSCOPE TOP
           aWAData[ WA_SCOPEBOT ][y] := aOrderInfo[ UR_ORI_NEWVAL ]
           IF LEN(aWAData[ WA_SCOPETOP ]) < y
              AADD(aWAData[ WA_SCOPETOP ],SPACE(LEN(CVALTOCHAR(aWAData[ WA_SCOPEBOT ][y])))) //THERE INST STILL A SCOPETOP ARRAYS MUST HAVE  SAME LEN
           ENDIF     
        ELSE
           AADD( aWAData[ WA_SCOPES ],aWAData[ WA_INDEXACTIVE ])
           AADD(aWAData[ WA_SCOPEBOT ],aOrderInfo[ UR_ORI_NEWVAL ])
           //AADD(aWAData[ WA_SCOPETOP ],SPACE(LEN(CVALTOCHAR(aWAData[ WA_SCOPEBOT ][1])))) //THERE INST STILL A SCOPETOP ARRAYS MUST HAVE  SAME LEN
           aOrderInfo[ UR_ORI_RESULT ] := ""
        ENDIF      

 
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 83 guests