ADORDD Error : ADODEFAULT(5256)

Re: ADORDD Error : ADODEFAULT(5256)

Postby AHF » Wed Jun 17, 2015 8:16 am

Ducth,

Please post your set SET ADO LOCK CONTROL

Please check the Lucas post in the topic 2012 server.
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADORDD Error : ADODEFAULT(5256)

Postby dutch » Wed Jun 17, 2015 9:37 am

Dear Antonio,

I have set SET ADO FORCE LOCK OFF as Lucas recommendation, it's working now.

Can I make SET RELATION TO ... INTO ....?

Thanks in advance,
Dutch
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1535
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: ADORDD Error : ADODEFAULT(5256)

Postby AHF » Wed Jun 17, 2015 9:48 am

Dutch,

You can do whatever you do with any other rdd like dbfcdx.

Please read the readme.pdf in github its like a small manual you have everything there.

The only limitation is the variables evaluation in index expressions as they are unknown to adordd SQL.
Here its just like ADS rdd.

And actions over delete records.

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

Re: ADORDD Error : ADODEFAULT(5256)

Postby dutch » Wed Jun 17, 2015 10:04 am

This is my sample code. I have 2 table and need to make RELATION but it got an error "ADORDD/1201 Work area not indexed: GST"
1. ccrtbl it has tbl_gstno = gst_intno in ccrgst
2. ccrgst
Now I try to make index for both table. What I do wrong?
Code: Select all  Expand view
#include 'adordd.ch'
#include 'fivewin.ch'
#include 'xbrowse.ch'

REQUEST ADORDD

Function main
LOCAL cSql :=""
local oDlg, oBrw, oFont, oBtn
 
    RddRegister("ADORDD",1)
    RddSetDefault("ADORDD")

    //This is the same as for other rdds
    SET AUTOPEN ON //might be OFF if you wish
    SET AUTORDER TO 1 // first index opened can be other
    SET ADO DEFAULT DATABASE TO "easyfo" SERVER TO "localhost" ENGINE TO "MYSQL" USER TO "root" PASSWORD TO "nimda" 
    SET ADO FORCE LOCK OFF
    SET ADO DEFAULT RECNO FIELD TO "ID"
    SET ADO TEMPORAY NAMES INDEX LIST TO {"TMP","TEMP"}
    SET ADODBF TABLE INDEX LIST TO { {"ccrtbl",{"CCRTBL1","UPPER(TBL_LAST)"}}, ;
                                                {"ccrgst",{"CCRGST1","GST_INTNO"}} ;
                                             }
    USE ccrgst ALIAS 'gst' NEW SHARED
    USE ccrtbl ALIAS 'tbl' NEW SHARED
        SET RELATION TO tbl->tbl_gstno INTO gst
    tbl->(dbgotop())

    DEFINE FONT oFont NAME 'Tahoma' SIZE 0, -14

    DEFINE DIALOG oDlg FROM 0, 0 TO 600, 800 TITLE 'Test ADORDD' PIXEL ;
             FONT oFont
   
        @  1, 1     XBROWSE oBrw OF oDlg ;
                    SIZE 350,280 PIXEL ;
                    FIELDS tbl->tbl_rmno, tbl->tbl_last, tbl->tbl_first, dtoc(tbl->tbl_arr), dtoc(tbl->tbl_dep) ;
                    HEADERS 'Room', 'Last', 'First', 'Arrival', 'Departure' ;
                    FIELDSIZES 50, 150, 150, 70, 70 ;
                    ALIAS 'tbl' ;  //                   SORT "tbl_rmno" ;
                    LINES
   
        oBrw:nMarqueeStyle      := MARQSTYLE_HIGHLROWMS
       oBrw:nMarqueeStyle      := MARQSTYLE_HIGHLROW
       oBrw:nRowDividerStyle   := LINESTYLE_LIGHTGRAY
       oBrw:nColDividerStyle   := LINESTYLE_LIGHTGRAY
       oBrw:nHeaderHeight      := 26
       oBrw:nRowHeight         := 24
       oBrw:lHScroll           := .F.
       oBrw:nStretchCol        := STRETCHCOL_LAST
       oBrw:lAllowRowSizing    := .F.
       oBrw:lColDividerComplete:= .T.

        oBrw:CreateFromCode()
   
        oDlg:oClient := oBrw
       
        @  281, 1   BTNBMP oBtn PROMPT 'Delete' OF oDlg SIZE 35, 20 PIXEL ;
                        2007 ;
                        ACTION (if(MsgYesNo('Delete : '+rtrim(tbl->Tbl_last)),tbl->(DbDelete()), ),oBrw:Refresh())

        @  281,41   BTNBMP oBtn PROMPT 'Guest Name' OF oDlg SIZE 35, 20 PIXEL ;
                        2007 ;
                        ACTION Msginfo('Guest Last : '+rtrim(tbl->Tbl_last))
       
    ACTIVATE DIALOG oDlg CENTER

CLOSE tbl

return nil
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1535
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: ADORDD Error : ADODEFAULT(5256)

Postby lucasdebeltran » Wed Jun 17, 2015 10:07 am

Dutch,

You have to set both SET ADO TABLES INDEX LIST TO... and SET ADODBF TABLES INDEX LIST TO...
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: ADORDD Error : ADODEFAULT(5256)

Postby dutch » Wed Jun 17, 2015 10:22 am

I did both set but still got the same error.
Code: Select all  Expand view
Application
==========
   Path and name : D:\V6\TADORDD\Release\test.EXE (32 bits)
   Gr๖฿e : 2,948,608 bytes
   Time from start : 0 hours 0 mins 57 secs
   Error occurred at : 06/17/15, 17:18:15
 Description : Error ADORDD/1201  Work area not indexed: GST

Stack Calls
===========
   Called from :  => UR_SUPER_ERROR(0)
   Called from : D:\V6\AdoRdd\adordd.prg => ADO_RELEVAL(3912)
   Called from : D:\V6\AdoRdd\adordd.prg => ADO_FORCEREL(3843)
   Called from : D:\V6\AdoRdd\adordd.prg => ADO_GOTOP(859)
   Called from :  => DBGOTOP(0)
   Called from : D:\V6\TADORDD\test.prg => MAIN(41)

Code: Select all  Expand view
    SET ADODBF TABLE INDEX LIST TO { {"ccrtbl",{"CCRTBL1","TBL_RMNO"}}, ;
                                                {"ccrgst",{"CCRGST1","GST_INTNO"}} ;
                                             }

    SET ADO TABLES INDEX LIST TO { {"ccrtbl",{"CCRTBL1","TBL_RMNO"}}, ;
                                                {"ccrgst",{"CCRGST1","GST_INTNO"}} ;
                                             }

lucasdebeltran wrote:Dutch,

You have to set both SET ADO TABLES INDEX LIST TO... and SET ADODBF TABLES INDEX LIST TO...
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1535
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: ADORDD Error : ADODEFAULT(5256)

Postby dutch » Wed Jun 17, 2015 10:34 am

Thank you so much Antonio and Lucas
Index is working now, when I change all to uppercase. The RELATION is working too.
Code: Select all  Expand view
    SET ADODBF TABLES INDEX LIST TO { {"CCRTBL",{"CCRTBL1","TBL_RMNO"}}, ;
                                                {"CCRGST",{"CCRGST1","GST_INTNO"}} ;
                                             }

    SET ADO TABLES INDEX LIST TO     { {"CCRTBL",{"CCRTBL1","TBL_RMNO"}}, ;
                                                {"CCRGST",{"CCRGST1","GST_INTNO"}} ;
                                             }

SET ADO TABLES INDEX LIST TO = indexes without of any clipper like expression only to be used by SQL

SET ADODBF TABLES INDEX LIST TO = indexes with the clipper like expressions needed by the app for its evaluations.

When we use &(indexkey(0)) we cant evaluate a index expression in ADO TABLES "name+dDate+nValue" we will get an error but we can issues a sql select like that.
Thus we need the ADODBF expression "name+DTOS(dDate)+STR(nValue) to do it.

The ADO indexes are for queries the ADODBF are for the normal clipper expressions to allow its evaluation.

ARRAY SPEC FOR BOTH CASES:
ATTENTION ALL MUST BE UPPERCASE
{ {"TABLE1",{"FIRST","FIRST"} }, {"TABLE2" ,{"CODID","CODID"}} }
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1535
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 27 guests