ADO RDD xHarbour

Re: ADO RDD xHarbour

Postby AHF » Fri May 15, 2015 9:50 am

Antonio,


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

I need this to COPY TO.
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby hmpaquito » Fri May 15, 2015 9:53 am

Code: Select all  Expand view
#include "dbinfo.ch"
dbInfo(DBI_FULLPATH)
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: ADO RDD xHarbour

Postby AHF » Fri May 15, 2015 10:54 am

Of course!

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

Re: ADO RDD xHarbour

Postby AHF » Fri May 15, 2015 12:41 pm

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?
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby AHF » Fri May 15, 2015 5:28 pm

New version adordd https://github.com/AHFERREIRA/adordd.git

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

Re: ADO RDD xHarbour

Postby byte-one » Fri May 15, 2015 7:39 pm

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",...
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: ADO RDD xHarbour

Postby AHF » Fri May 15, 2015 8:31 pm

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.
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby byte-one » Sat May 16, 2015 7:03 am

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. ???
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: ADO RDD xHarbour

Postby AHF » Sat May 16, 2015 8:01 am

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.
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby AHF » Mon May 18, 2015 8:10 pm

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 ?
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 5:45 am

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.
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 6:50 am

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?
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 7:55 am

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.
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 8:07 am

Lucas ,

What version are you using?
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:11 am

Antonio,

"AdoRdd Version 1.150515/2"
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: Google [Bot], Willi Quintana and 98 guests