ADORDD Error : ADODEFAULT(5256)

ADORDD Error : ADODEFAULT(5256)

Postby dutch » Tue Jun 16, 2015 4:49 am

I'm just new with ADORDD, I try the ADORDD.PRG but it has got an error below

This is my example, what I do wrong?
Code: Select all  Expand view
#include 'adordd.ch'
#include 'fivewin.ch'

REQUEST ADORDD

Function main
LOCAL cSql :=""
 
    RddRegister("ADORDD",1)
    RddSetDefault("ADORDD")
   
   USE easyfo TABLE "ccrtbl" VIA "ADORDD" ALIAS "tbl" MYSQL ;
      FROM "localhost" USER "root" PASSWORD "nimda"

msginfo( tbl->tbl_intno )

CLOSE tbl

return nil

Code: Select all  Expand view
  Error description: Error BASE/1132  Bound error: array access
   Args:
     [   1] = A   { ... } length: 0
     [   2] = N   1

Stack Calls
===========
   Called from: D:\FTDN\adordd\AdoRdd\adordd.prg => ADODEFAULTS( 5256 )
   Called from: D:\FTDN\adordd\AdoRdd\adordd.prg => ADOCONNECT( 413 )
   Called from: D:\FTDN\adordd\AdoRdd\adordd.prg => ADO_OPEN( 255 )
   Called from:  => DBUSEAREA( 0 )
   Called from: D:\V6\TADORDD\test.prg => MAIN( 17 )
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 » Tue Jun 16, 2015 6:52 am

Dutch,

You need to set ado before:

Code: Select all  Expand view

//all your tables and index files used by your app without any clipper expressions
// if you need to use indexes you need this set otherwise you have t create them
// every time app run
SET ADO TABLES INDEX LIST TO { {"TABLE1",{"FIRST","FIRST"} }, {"TABLE2" ,{"CODID","CODID"}} }

//all your tables and index files used by your app with clipper expressions
// if you need to use indexes you need this set otherwise you have t create them
// every time app run
SET ADODBF TABLES INDEX LIST TO {  {"TABLE1",{"FIRST","FIRST"} }, {"TABLE2" ,"CODID","CODID"}} }

//temporay index file names must star with tmp or temp
SET ADO TEMPORAY NAMES INDEX LIST TO {"TMP","TEMP"}

//this is a must you have to indicate whats the autoinc field used as recno()
//without it will not navigate correctly
// you can indicate by table
SET ADO FIELDRECNO TABLES LIST TO {{"TABLE1","FIRST"},{"TABLE2","CODID"}}
//or by default
SET ADO DEFAULT RECNO FIELD TO "HBRECNO"

//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
   
//default connection if for ACCESS YOU NEED TO INCLUDE FULL PATH
SET ADO DEFAULT DATABASE TO "testadordd" SERVER TO "localhost"  ENGINE TO "MYSQL" USER TO "adordd" PASSWORD TO ""   

//control locking in adordd for both table and record dont puT final \
 SET ADO LOCK CONTROL SHAREPATH TO  "D:\WHATEVER" RDD TO "DBFCDX"

//dont need lock control
SET ADO FORCE LOCK OFF

//AFTER SETTINGS DONE
//we can just use table
use TABLE1 alias "whatever"

//or we can open another con
use "TABLE1@"Driver={mySQL ODBC 5.3 ANSI Driver};" + ;
                "
server=localhost" + ;
                "
;Port=3306;Option=32"+;
                "
;database=otherdatabase"   + ;
                "
;uid=adordd" + ;
                "
;pwd=''" +";" ALIAS "whatever"




For you trial:

SET ADO DEFAULT DATABASE TO "ccrtbl" SERVER TO "localhost" ENGINE TO "MYSQL" USER TO "root" PASSWORD TO "nimda"

//if you want to try locks
//control locking in adordd for both table and record dont puT final \
SET ADO LOCK CONTROL SHAREPATH TO "your Drive:\WHATEVER" RDD TO "DBFCDX"
//dont need lock control
SET ADO FORCE LOCK OFF

SET ADO DEFAULT RECNO FIELD TO "my autoinc field" //indicate your autoinc filed in the table (default for all)

USE easyinfo ALIAS "tbl"

//THIS IS THECORRECT SYNTAX
// DONT USE IT IM GOING TO TAKE THIS OUT
//AS IT WILL NOT BE NEEDED WITH ALTERNATIVES ABOVE.
USE easyfo VIA "ADORDD" ALIAS "tbl" FROM DATABASE "ccrtbl" MYSQL ;
FROM SERVER "localhost" USER "root" PASSWORD "nimda"

Please try it and let me know.
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADORDD Error : ADODEFAULT(5256)

Postby dutch » Tue Jun 16, 2015 7:45 am

I need to use MySql and how to set this following line. I'm not quite clear.
Code: Select all  Expand view
    SET ADO LOCK CONTROL SHAREPATH TO "E:\TEMP" RDD TO "DBFCDX"

This line is used for index expression. If I have 12 tag (DBFCDX) in 1 table, I have to define at the begining of the program every time the program start.
Code: Select all  Expand view
SET ADODBF TABLES INDEX LIST TO {  {"TABLE1",{"FIRST","FIRST"} ,{"LAST","LAST"},{"MEMNO","MEMNO"},{"TYPE+LAST","TYPE+LAST"},{"BIRTHDATE","DTOS(BIRTHDATE)"},etc.}, {"TABLE2" ,"CODID","CODID"}} }
Last edited by dutch on Tue Jun 16, 2015 9:30 am, edited 1 time in total.
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 Horizon » Tue Jun 16, 2015 9:20 am

dutch wrote:I need to use MySql and how to set this following line. I'm not quite clear.
Code: Select all  Expand view
    SET ADO LOCK CONTROL SHAREPATH TO "E:\TEMP" RDD TO "DBFCDX"


+1
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1288
Joined: Fri May 23, 2008 1:33 pm

Re: ADORDD Error : ADODEFAULT(5256)

Postby dutch » Tue Jun 16, 2015 10:12 am

This line does return incorrect. Because it cannot find the "TLOCKS" table in MySql Database. It is warning everytime when open the program.

It will effect, if turn LOCK CONTROL ON. I think it will be find, If use "DBFCDX" but still got problem with "MySql".
SET ADO LOCK CONTROL SHAREPATH TO "E:\TEMP" RDD TO "ADORDD" // DBFCDX"
Code: Select all  Expand view
cTable := cPath+"\TLOCKS"+RDDINFO(RDDI_TABLEEXT,,rRdd)
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 » Tue Jun 16, 2015 10:36 am

Hello,

Please set SET ADO FORCE LOCK OFF.

So MySQL will do the locking.

This feature was a special situation for Antonio´s customer.

So, the settings will be:

Code: Select all  Expand view


  SET ADO DEFAULT RECNO FIELD TO "HBRECNO"

  SET AUTOPEN OFF //ON //might be OFF if you wish

  //SET AUTORDER TO 1 // first index opened can be other

  SET ADO FORCE LOCK OFF

  SET ADO DEFAULT DATABASE TO cDataBase SERVER TO cServer  ENGINE TO "MYSQL" USER TO cUser PASSWORD TO cPassWord


 
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 AHF » Tue Jun 16, 2015 10:45 am

Dutch,
dutch wrote:This line does return incorrect. Because it cannot find the "TLOCKS" table in MySql Database. It is warning everytime when open the program.

It will effect, if turn LOCK CONTROL ON. I think it will be find, If use "DBFCDX" but still got problem with "MySql".
SET ADO LOCK CONTROL SHAREPATH TO "E:\TEMP" RDD TO "ADORDD" // DBFCDX"
Code: Select all  Expand view
cTable := cPath+"\TLOCKS"+RDDINFO(RDDI_TABLEEXT,,rRdd)


Can you post here all ado sets?

The TLOCKS table isn't SQL but dbfcdx or other Harbour rdd that allow true lock.

SET ADO LOCK CONTROL SHAREPATH TO "E:\TEMP" RDD TO "DBFCDX"

You have to supply to the sharepath and the rddname. Thats it.

Of course that rdd must be linked with your app because it will be used.

Code: Select all  Expand view
SET ADODBF TABLES INDEX LIST TO {  {"TABLE1",{"FIRST","FIRST"} ,{"LAST","LAST"},{"MEMNO","MEMNO"},{"TYPE+LAST","TYPE+LAST"},{"BIRTHDATE","DTOS(BIRTHDATE)"},etc.}, {"TABLE2" ,"CODID","CODID"}} }


Concerning indexes this has to be placed before trying to open any file.

But you will need also the
Code: Select all  Expand view
SET ADO TABLES INDEX LIST TO {  {"TABLE1",{"FIRST","FIRST"} ,{"LAST","LAST"},{"MEMNO","MEMNO"},{"TYPE+LAST","TYPE,LAST"},{"BIRTHDATE","BIRTHDATE"},etc.}, {"TABLE2" ,"CODID","CODID"}} }


Please check the changes + with , The first "TYPE+LAST" I assume is the index name you want.

You can see these two sets has:

SET ADO TABLES all index expressions without any clipper function and the fields separated by ,.
These are used to build SQL SELECT expression ORDER BY

SET ADODBF TABLES are the same but with clipper fuctions and fields with +.
These are used to evaluate clipper expression ex:
&(indexkey(0))
ordkey()
ordfor()
etc.

I hope to have answer you question.
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADORDD Error : ADODEFAULT(5256)

Postby vilian » Tue Jun 16, 2015 7:42 pm

Hi Antonio,

We have a bigger ERP (more 400 prg) with many of 300 dbf files, and want try use ADORDD with MySql.

I´m not understand how to use SET ADODBF commands.
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 920
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: ADORDD Error : ADODEFAULT(5256)

Postby AHF » Tue Jun 16, 2015 7:57 pm

Vilian,

Did you get the last version posted a couple of hours ago and read the readme thats now more like a small manual?
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADORDD Error : ADODEFAULT(5256)

Postby vilian » Tue Jun 16, 2015 8:04 pm

Antônio,

Thanks, I will get now.
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 920
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: ADORDD Error : ADODEFAULT(5256)

Postby vilian » Tue Jun 16, 2015 8:49 pm

Antônio,

We have 287 DBF files and 472 CDX files.
We need to use SET ADODBF and SET ADO Tables only in main program or anyway open files ?
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 920
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: ADORDD Error : ADODEFAULT(5256)

Postby dutch » Tue Jun 16, 2015 9:51 pm

Thanks Lucas,
I have set LOCK OFF as your recommendation. It works now.
lucasdebeltran wrote:Hello,
Please set SET ADO FORCE LOCK OFF.

So MySQL will do the locking.
Code: Select all  Expand view


  SET ADO DEFAULT RECNO FIELD TO "HBRECNO"

  SET AUTOPEN OFF //ON //might be OFF if you wish

  //SET AUTORDER TO 1 // first index opened can be other

  SET ADO FORCE LOCK OFF

  SET ADO DEFAULT DATABASE TO cDataBase SERVER TO cServer  ENGINE TO "MYSQL" USER TO cUser PASSWORD TO cPassWord
 

Dear Antonio F.,
I try to find in ADORDD.PRG, because I got an error message for existing table TLOCKS in MySql. You have checked the existing TLOCKS.DBF from SET ADO LOCK CONTROL SHAREPATH TO .... setting but it got an error message when I use MySql DB.

If I use Clipper Expression in INDEX file, I need only SET ADODBF TABLE INDEX LIST TO. Is it correct?

Thanks in advance.
AHF wrote:Dutch,

Can you post here all ado sets?

The TLOCKS table isn't SQL but dbfcdx or other Harbour rdd that allow true lock.

SET ADO LOCK CONTROL SHAREPATH TO "E:\TEMP" RDD TO "DBFCDX"

You have to supply to the sharepath and the rddname. Thats it.

Of course that rdd must be linked with your app because it will be used.

Code: Select all  Expand view
SET ADODBF TABLES INDEX LIST TO {  {"TABLE1",{"FIRST","FIRST"} ,{"LAST","LAST"},{"MEMNO","MEMNO"},{"TYPE+LAST","TYPE+LAST"},{"BIRTHDATE","DTOS(BIRTHDATE)"},etc.}, {"TABLE2" ,"CODID","CODID"}} }


Concerning indexes this has to be placed before trying to open any file.

But you will need also the
Code: Select all  Expand view
SET ADO TABLES INDEX LIST TO {  {"TABLE1",{"FIRST","FIRST"} ,{"LAST","LAST"},{"MEMNO","MEMNO"},{"TYPE+LAST","TYPE,LAST"},{"BIRTHDATE","BIRTHDATE"},etc.}, {"TABLE2" ,"CODID","CODID"}} }


Please check the changes + with , The first "TYPE+LAST" I assume is the index name you want.

You can see these two sets has:

SET ADO TABLES all index expressions without any clipper function and the fields separated by ,.
These are used to build SQL SELECT expression ORDER BY

SET ADODBF TABLES are the same but with clipper fuctions and fields with +.
These are used to evaluate clipper expression ex:
&(indexkey(0))
ordkey()
ordfor()
etc.

I hope to have answer you question.
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 » Tue Jun 16, 2015 9:52 pm

Vilian,

All the sets only need to set once at top of main or some init program.
You only need to set ADO TABLE and ADODBF TABLE the tables with indexes.
Tables without indexes dont have to be set.
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADORDD Error : ADODEFAULT(5256)

Postby AHF » Tue Jun 16, 2015 10:06 pm

Code: Select all  Expand view
Dear Antonio F.,
I try to find in ADORDD.PRG, because I got an error message for existing table TLOCKS in MySql. You have checked the existing TLOCKS.DBF from SET ADO LOCK CONTROL SHAREPATH TO .... setting but it got an error message when I use MySql DB.

If I use Clipper Expression in INDEX file, I need only SET ADODBF TABLE INDEX LIST TO. Is it correct?

Thanks in advance.


I dont understand very well you question.
Please read last readme posted in Github.

You need always to set both ADODBF TABLES and ADO TABLES
How do you have a tLocks in MySql ?
Do you have such a table already in your app?
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 2:37 am

Dear Antonio F.,

If I use MySql, I have to set ADODBF TABLES with Clipper Expression Index.
Do I need to set ADO TABLES also?
AHF wrote:You need always to set both ADODBF TABLES and ADO TABLES


Yes, It has created in my MySql Db.
No, It just create from your code (LOCK CONTROL)
AHF wrote:How do you have a tLocks in MySql ?
Do you have such a table already in your app?
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

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 87 guests