ADO RDD xHarbour

Re: ADO RDD xHarbour

Postby AHF » Tue May 19, 2015 8:24 am

Lucas,

Error lines dont match that version.

Can you post lines here?

Tlocks file does not exist? Was not created?
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby lucasdebeltran » Tue May 19, 2015 8:31 am

Hello,

Please, try this sample:

Code: Select all  Expand view  RUN


#include "fivewin.ch"

#include "adordd\adordd.ch"
#include "adordd\adordd.prg"



REQUEST ADORDD, DBFCDX

function Main()


  RddRegister("ADORDD",1)
  RddSetDefault("ADORDD")


  SET ADODBF TABLES INDEX LIST TO { { "TABLE1", {"TEST1", "FIRST"} ,;
                                               {"TEST2", "LAST"} ,;
                                               {"TEST3", "AGE"} },;
                                    {"LUCAS", {"LUCAS1", "NOMBRE"}}          }



  SET ADO TABLES INDEX LIST TO {{ "TABLE1", {"TEST1", "FIRST"} ,;
                                            {"TEST2", "LAST"} ,;
                                            {"TEST3", "AGE"} },;
                                    {"LUCAS", {"LUCAS1", "NOMBRE"}}          }



  SET ADO DEFAULT RECNO FIELD TO "ID"

 // SET AUTOPEN ON //might be OFF if you wish
 // SET AUTORDER TO 1 // first index opened can be other


  SET ADO DEFAULT DATABASE TO "LUCASTABLE.MDB"  ENGINE TO "ACCESS" USER TO "" PASSWORD TO ""

//  SET ADO LOCK CONTROL SHAREPATH TO "C:" RDD TO "DBFCDX"



  IF !FILE( "LUCASTABLE.MDB" )

      msginfo("creating LUCASTABLE.MDB")

      DbCreate( "TABLE1", { { "FIRST", "C", 30, 0 },;
                            { "LAST", "C", 30, 0 },;
                            { "AGE", "N", 8, 0 },;
                            { "ID" ,"+",10, 0} }, "ADORDD" )

      DbCreate( "LUCAS", { { "NOMBRE", "C", 30, 0 },;
                           { "ID" ,"+",10, 0} }, "ADORDD" )

  ENDIF



  //
  // Open DBFS
  USE LUCAS NEW ALIAS "LUCAS"
  LUCAS->(ORDSETFOCUS("LUCAS1"))
  ?ordsetfocus()
  BROWSE()


  //
  USE TABLE1 ALIAS "TEST2" NEW
  OrdSetFocus("TEST1")
  ?ordsetfocus()

  TEST2->(  OrdSetFocus("TEST2")  )

  msginfo(ordsetfocus() + SPACE(20), "Changed to TEST2" )



  XBROWSER FASTEDIT




   APPEND BLANK
   test2->First   := "HOMER si no Homer"
   test2->Last    := "Simpson"
   test2->Age     := 45

   APPEND BLANK
   test2->First   := cValToChar( nRandom() ) + " aaa Lara"
   test2->Last    := "Croft si no"
   test2->Age     := 32


   GO TOP

   Browse()
   DbCloseAll()




return nil
 
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 lucasdebeltran » Tue May 19, 2015 8:47 am

Antonio,

Also indexes with conditions do not work, here LUCAS2:


SET ADODBF TABLES INDEX LIST TO { { "TABLE1", {"TEST1", "FIRST"} ,;
{"TEST2", "LAST"} ,;
{"TEST3", "AGE"} },;
{"LUCAS", {"LUCAS1", "NOMBRE"} ,;
{"LUCAS2", "NOMBRE", "FOR NOMBRE = 'AGAMENON'"} } }
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 » Tue May 19, 2015 9:01 am

Lucas,

Your trial its working ok!

Please note as in Harbour before ORDSETFOCUS() you need to SET INDEX TO if SET AUTO OPEN not defined.

Appends are done ok.

Tlocks its created ok.
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby AHF » Tue May 19, 2015 9:04 am

Lucas,

Im not working with xBrowse so I didnt try with it.

Is the problem with xbrowse? Does browse works ok?
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby AHF » Tue May 19, 2015 9:17 am

Lucas,

Its working ok.

Correct syntax:

Code: Select all  Expand view  RUN

 SET ADODBF TABLES INDEX LIST TO { { "TABLE1", {"TEST1", "FIRST"} ,;
                                               {"TEST2", "LAST"} ,;
                                               {"TEST3", "AGE"} },;
                                    {"LUCAS", {"LUCAS1", "NOMBRE","NOMBRE = 'AGAMENON'"}}          }



  SET ADO TABLES INDEX LIST TO {{ "TABLE1", {"TEST1", "FIRST"} ,;
                                            {"TEST2", "LAST"} ,;
                                            {"TEST3", "AGE"} },;
                                    {"LUCAS", {"LUCAS1", "NOMBRE","WHERE NOMBRE = 'AGAMENON'"}}    
 
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby lucasdebeltran » Tue May 19, 2015 9:19 am

Antonio,

Xbrowse seems to be working fine.

I delete tlocks and it seems to be working now.

But indexes with conditions no:

Code: Select all  Expand view  RUN


  SET ADO TABLES INDEX LIST TO {{ "TABLE1", {"TEST1", "FIRST"} ,;
                                            {"TEST2", "LAST"} ,;
                                            {"TEST3", "AGE"} },;
                                    {"LUCAS", {"LUCAS1", "NOMBRE"} ,;
                                              {"LUCAS2", "NOMBRE"  }     }     }


  SET ADODBF TABLES INDEX LIST TO { { "TABLE1", {"TEST1", "FIRST"} ,;
                                               {"TEST2", "LAST"} ,;
                                               {"TEST3", "AGE"} },;
                                    {"LUCAS", {"LUCAS1", "NOMBRE"} ,;
                                              {"LUCAS2", "NOMBRE", "WHERE NOMBRE = 'AGAMENON'"} } }


  //
  // Open DBFS
  USE LUCAS NEW ALIAS "LUCAS"
  LUCAS->(ORDSETFOCUS("LUCAS1"))
  ?ordsetfocus()
  BROWSE()


  LUCAS->(ORDSETFOCUS("LUCAS2"))
  dbgotop()
  ?ordsetfocus()
  xbrowser fastedit



 



LUCAS2 index does not eval the condition.
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 » Tue May 19, 2015 9:24 am

Lucas,

Place in adordd at line 2231 MSGINFO(CSQL) is teh select correct?
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby lucasdebeltran » Tue May 19, 2015 9:26 am

In wich function?.

I had to remove some of your starting code at adordd.prg so as to compile with Harbour.
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 » Tue May 19, 2015 9:32 am

Lucas,

Index condition its working
Lucas table its empty I try it with:

{"TEST3", "AGE","WHERE AGE = 32"} }

Please place this function in your trials to check rdd status.

Code: Select all  Expand view  RUN

FUNCTION rddreport()

LOCAL cerrorlog := "",n,j,ntarget,x

   for n = 1 to 255
      if ! Empty( Alias( n ) )
         cErrorLog += CRLF + Str( n, 3 ) + ": " + If( Select() == n,"=> ", "   " ) + ;
                      PadR( Alias( n ), 15 ) + Space( 20 ) + "NomeRDD: " + ;
                      ( Alias( n ) )->( RddName() ) + CRLF
         cErrorLog += "     ==============================" + CRLF
         cErrorLog += "     RecNo    RecCount    BOF   EOF" + CRLF
         cErrorLog += "    " + Transform( ( Alias( n ) )->( RecNo() ), "99999" ) + ;
                      "      " + Transform( ( Alias( n ) )->( RecCount() ), "99999" ) + ;
                      "      " + cValToChar( ( Alias( n ) )->( BoF() ) ) + ;
                      "   " + cValToChar( ( Alias( n ) )->( EoF() ) ) + CRLF + CRLF
         cErrorLog += "     Índices em uso " + Space( 23 ) + "TagName" + CRLF
     
         for j = 1 to 15
            if ! Empty( ( Alias( n ) )->( IndexKey( j ) ) )
               cErrorLog += Space( 8 ) + ;
                            If( ( Alias( n ) )->( IndexOrd() ) == j, "=> ", "   " ) + ;
                            PadR( ( Alias( n ) )->( IndexKey( j ) ), 35 ) + ;
                            ( Alias( n ) )->( OrdName( j ) ) + ;
                            CRLF
            endif
         next
         
         cErrorLog += CRLF + "     Relações em uso " + CRLF
         for j = 1 to 8
            if ! Empty( ( nTarget := ( Alias( n ) )->( DbRSelect( j ) ) ) )
               cErrorLog += Space( 8 ) + Str( j ) + ": " + ;
                            "TO " + ( Alias( n ) )->( DbRelation( j ) ) + ;
                            " INTO " + Alias( nTarget ) + CRLF
               // uValue = ( Alias( n ) )->( DbRelation( j ) )
               // cErrorLog += cValToChar( &( uValue ) ) + CRLF
            endif
         next
      x :=  (alias(n))->(dbrlocklist())
      cErrorLog += Space( 8 ) +"Registos fechados "+CRLF
      for j = 1 to len(x)
          cErrorLog += Space( 8 ) + "Registo nr "+str(x[j])+CRLF
      next

      endif
   next
   SHOWMEMO(cerrorlog)

RETURN .t.

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

Re: ADO RDD xHarbour

Postby AHF » Tue May 19, 2015 9:33 am

Lucas,

May be you can help me.
Im still with a problems with dates in MYSQL.

1) Edit a date field and place any date ok.

2) Delete that date and leave it blank date ok

3) Edit again and place a new date ok bu if edit iit again and keep the date blank error!
I try with adoshowerror but nothing only unknown error.

Do you have any clue?

How can we set a date field with empty date?


Can you help me with this?
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby lucasdebeltran » Tue May 19, 2015 9:37 am

Antonio,

Where are you putting this?

{"TEST3", "AGE","WHERE AGE = 32"} }

In SET ADO TABLES or in SET ADODBF TABLES?.

As long as I can´t use adordd in a full working application, I can´t test dates behaviour.
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 » Tue May 19, 2015 9:44 am

Lucas,

Where are you putting this?

{"TEST3", "AGE","WHERE AGE = 32"} }

In SET ADO TABLES or in SET ADODBF TABLES?.


In SET ADO TABLES the sql expressions never clipper expression
In SET ADODBF TABLES only clipper expressions. In conditions please don't place FOR or WHILE keyword but only the condition.Ex "AGE = 32"

That s it.

As long as I can´t use adordd in a full working application, I can´t test dates behaviour.


If you create a date field in your trail DB you will see what is the problem when changing it to empty.
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby lucasdebeltran » Tue May 19, 2015 9:50 am

Antonio,

It´s not working:


SET ADO TABLES INDEX LIST TO {{ "TABLE1", {"TEST1", "FIRST"} ,;
{"TEST2", "LAST"} ,;
{"TEST3", "AGE"} },;
{"LUCAS", {"LUCAS1", "NOMBRE"} ,;
{"LUCAS2", "NOMBRE", },;
{"LUCAS3", "NOMBRE"} } }


SET ADODBF TABLES INDEX LIST TO { { "TABLE1", {"TEST1", "FIRST"} ,;
{"TEST2", "LAST"} ,;
{"TEST3", "AGE"} },;
{"LUCAS", {"LUCAS1", "NOMBRE"} ,;
{"LUCAS2", "NOMBRE", "NOMBRE = 'AGAMENON'"},;
{"LUCAS3", "NOMBRE", "ACTIVO = .T." } } }




I set ordsetfocus to LUCAS2 or LUCAS3 with NO LUCK.
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 lucasdebeltran » Tue May 19, 2015 9:52 am


1: => LUCAS NomeRDD: ADORDD
==============================
RecNo RecCount BOF EOF
2 3 .F. .F.

Índices em uso TagName
NOMBRE LUCAS1
NOMBRE LUCAS2
=> NOMBRE LUCAS3

Relações em uso
Registos fechados

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

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 53 guests