Page 37 of 70

Re: ADO RDD xHarbour

PostPosted: Fri May 15, 2015 9:50 am
by AHF
Antonio,


How can I get the complete file name of an open area?

I need this to COPY TO.

Re: ADO RDD xHarbour

PostPosted: Fri May 15, 2015 9:53 am
by hmpaquito
Code: Select all  Expand view
#include "dbinfo.ch"
dbInfo(DBI_FULLPATH)

Re: ADO RDD xHarbour

PostPosted: Fri May 15, 2015 10:54 am
by AHF
Of course!

Thanks.

Re: ADO RDD xHarbour

PostPosted: Fri May 15, 2015 12:41 pm
by AHF
Im facing the following problem:

When we use Date() to place in a date field should it be Date() or Sql Now() ?

If there are several workstations in different time zones and if the field date corresponds for ex. to an order number to have last order number with the last date this might fail.

On other hand working with sql Now() brings also problems that the document might have a date posterior to the actual date which means the doc shouldn't be use before that date.

In the cases where there aren't any relations between numbers and dates can it be always sql Now()?

What is your experience? Can you share it?

Re: ADO RDD xHarbour

PostPosted: Fri May 15, 2015 5:28 pm
by AHF
New version adordd https://github.com/AHFERREIRA/adordd.git

Check readme

Re: ADO RDD xHarbour

PostPosted: Fri May 15, 2015 7:39 pm
by byte-one
Antonio, in adordd.prg you use often:
Code: Select all  Expand view
ALLTRIM(STR(nRecord,0))

This code produces a error! STR with len 0 is not allowed?

In some cases the parameter nRecord ist from type "C" and a runtime-error is displayed if following code in adordd.prg is called from tryadordd.prg:
Code: Select all  Expand view
MSGINFO("Relations in ADO SQL with record number are not allowed! See adordd.prg")
            nReturn := ADO_GOTO( aRelInfo[ UR_RI_CHILD ], uResult ) //-> uResult is type "C"

 
In tryadordd the database and table should be:
Code: Select all  Expand view
DbCreate( "table1;"+cPath+"\test2.mdb", ....
and
Code: Select all  Expand view
DbCreate( "table2;"+cPath+"\test2.mdb",...

Re: ADO RDD xHarbour

PostPosted: Fri May 15, 2015 8:31 pm
by AHF
Code:
ALLTRIM(STR(nRecord,0))

This code produces a error! STR with len 0 is not allowed?


You are absolutely right!
The strange its that here with xHarbour Set 2008 this is accepted. No error!
Corrected anyway! The length should be 10,0

In some cases the parameter nRecord ist from type "C" and a runtime-error is displayed if following code in adordd.prg is called from tryadordd.prg:
Code:
MSGINFO("Relations in ADO SQL with record number are not allowed! See adordd.prg")
nReturn := ADO_GOTO( aRelInfo[ UR_RI_CHILD ], uResult ) //-> uResult is type "C"


The nRecord its always N type.
Unless bookmarks are used and with it the results will be unpredictable. (no defined field as recno)
The ADOGOTO was left there by mistake when we were trying it.
Corrected taken out.
You only (should ) get there if there is a relation and no index.

In tryadordd.prg you're right I changed the dbcreate proposed by Lucas and I forgot to change tryadordd.

Thanks a lot for your comments.

Is adordd working ok for you?

It will be a great help to have your feed back.

Re: ADO RDD xHarbour

PostPosted: Sat May 16, 2015 7:03 am
by byte-one
Antonio, in the command SET ADO LOCK CONTROL SHAREPATH TO cPath RDD TO "DBFCDX" you sets the RDD for tlocks.dbf. In the code of adordd.prg should the extension from the indexfile not hardcoded ("CDX") as if i use another RDD the extension is another one! This hardcoded "CDX" are present on some places!

Little correction: The right text in STATIC FUNCTION ADO_RELEVAL( nWA, aRelInfo ) is "allowed"

In tryadordd.prg the relation should finished after the Do WHILE...

MSGINFO("DOES TABLE1 EXISTS ON DB ?"+CVALTOCHAR(hb_adoRddExistsTable( "table1") )) shows .F. ???

Re: ADO RDD xHarbour

PostPosted: Sat May 16, 2015 8:01 am
by AHF
byte-one,

Ill change it to IndexExt() and TableExt()

Little correction: The right text in STATIC FUNCTION ADO_RELEVAL( nWA, aRelInfo ) is "allowed"


Sorry Im not getting it.

If you want to test it simply place SET RELATION TO or not if you want try it browse fields from 2 areas to see it.

hb_adoRddExistsTable - This only queries the Schema I think if you are using Access it doesn't work.
I didn't do it because who wants access when you can have any SQL database?

Thanks for your info.

Re: ADO RDD xHarbour

PostPosted: Mon May 18, 2015 8:10 pm
by AHF
Antonio,

adordd is working with copy to and copy struct when the table source is opened with via adordd.
Thus it goes directly to ado_trans and we have the control to do it either to another table via adordd or to other rdd.

The problem is when the source table is for ex. dbfcdx then _dbcopy executes and calls ado_append and ado_putvalue and I cant find why on the last record it errors after :update() in ado_putvalue.


With this done it will be very easy to export all tables from ex. dbfcdx to any adordd data source.

Can you inform were can I find source __dbcopy ?

Re: ADO RDD xHarbour

PostPosted: Tue May 19, 2015 5:45 am
by lucasdebeltran
Antonio,

Can you please post last version?.

In that version, dbcreate takes default database name indicated in SET ADO DEFAULT DATABASE TO command?.

Thank you.

Re: ADO RDD xHarbour

PostPosted: Tue May 19, 2015 6:50 am
by AHF
Lucas,

I think last version posted already does that.

Please try it and inform.

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?

Re: ADO RDD xHarbour

PostPosted: Tue May 19, 2015 7:55 am
by lucasdebeltran
Antonio,

It´s not working:

After creating a new table:

Error description: (DOS Error 2) DBFCDX/1003 Open error: C:\ADORDD2015\TLOCKS.CDX

Stack Calls
===========
Called from: => ORDLISTADD( 0 )
Called from: ../../../rddord.prg => DBSETINDEX( 0 )
Called from: test.prg => ADO_GETUNLOCK( 2776 )


Also, Append does not work fine.

The first time I append a record:

Image

When appending next records, it seems ok.

Re: ADO RDD xHarbour

PostPosted: Tue May 19, 2015 8:07 am
by AHF
Lucas ,

What version are you using?

Re: ADO RDD xHarbour

PostPosted: Tue May 19, 2015 8:11 am
by lucasdebeltran
Antonio,

"AdoRdd Version 1.150515/2"