Migrating to Harbour

Re: Migrating to Harbour

Postby James Bott » Fri Jan 09, 2015 6:30 pm

Thanks Antonio.

I just posted my suggestion of using a flag to solve the problem on the Developer's forum. It seems to be the only practical solution.
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Migrating to Harbour

Postby Enrico Maria Giordano » Fri Jan 09, 2015 6:35 pm

Thanks to all, my friends.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Migrating to Harbour

Postby Antonio Linares » Fri Jan 09, 2015 6:44 pm

James,

Yes, I saw your new post, thanks :-)

Enrico,

My pleasure to help you and all Harbour users :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42206
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Migrating to Harbour

Postby nageswaragunupudi » Sat Jan 10, 2015 12:50 am

I just saw the discussions there. They think the change is requested only for Excel.
No.
All SQL databases expect assignment of NULL for empty dates, whether we use ADO or not,
So we need to convert empty dates as NULLs while assigning through ADO. In other words our OLE library has to convert empty dates as NULLs while assigning.

There was also mention about the limitation of excel about the lowest being 1900-01-01. This is the limitation of other Microsoft SQL databases also. Other SQL DBMS like Oracle, MySql all accept all dates.

Our request is not purely Excel centric as they are discussing.
Issue of dates lower than 1900-01-01 has to be handed by the programmer ( even using pure SQL ), We wanted only empty dates to be assigned as NULLs.

It appears to me that really serious ADO programmers are not still using Harbour.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10690
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Migrating to Harbour

Postby nageswaragunupudi » Sat Jan 10, 2015 1:02 am

Mr EMG

Even assuming that Harbour provides the same functionality as that of xHarbour, we still may have to adopt some kind of conditional coding for assignment of Dates if we want our code to be generic ( not targeted to single DBMS only)

Example:
oRs:Fields( "SomeDate" ):Value := STOD( "17000101" )
This works for Oracle, MYSql and all non-Microsoft products.
But errors our for Microsoft products like Excel, MSSQL.

Out generic code needs to be something like this:

<ole/adoref>:Value := If( lMicrosoft .and. ValType( v ) $ "DT" .and Year( v ) < 1900, AdoNull(), v )
( and lMicrosoft is set to .t. for Excel, Access, MSSQL, etc)

There is a reason why I used AdoNull() but not NIL.
In case of MSSQL, assigning "nil" results in assigning 1899-12-30 ( numeric 0 in OLE dates)
So it is safer to use AdoNull() in all cases rather than NIL.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10690
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Migrating to Harbour

Postby Rick Lipkin » Sat Jan 10, 2015 4:43 pm

Here is the thread from the xHarbour group that I raised several years ago and the ADO fix for ctod("") writing null to Sql Server .. the same modifications may be able to be ported to Harbour.

https://groups.google.com/forum/?fromgr ... NneK8sbdgJ

Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2667
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Migrating to Harbour

Postby nageswaragunupudi » Sat Jan 10, 2015 8:23 pm

Rick Lipkin wrote:Here is the thread from the xHarbour group that I raised several years ago and the ADO fix for ctod("") writing null to Sql Server .. the same modifications may be able to be ported to Harbour.

https://groups.google.com/forum/?fromgr ... NneK8sbdgJ

Rick Lipkin

If at all the Harbour team agrees to modify.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10690
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Migrating to Harbour

Postby lucasdebeltran » Sat Jan 10, 2015 8:46 pm

Dear Mr. Nages,

In my opinion, it is very important that you post your previous responses to the Harbour Developer´s Group.

They will have another very qualified experience from your high profile.

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: Migrating to Harbour

Postby Antonio Linares » Sun Jan 11, 2015 8:58 am

+1 :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42206
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Migrating to Harbour

Postby Enrico Maria Giordano » Sun Jan 11, 2015 2:37 pm

I just read the various replies here:

https://groups.google.com/forum/#!topic/harbour-devel/IrZFS5ePSnc

I wonder how can we use a compiler managed by such developers...

For the sake of truth, Przemek at least offered a solution...

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Migrating to Harbour

Postby lucasdebeltran » Sun Jan 11, 2015 4:59 pm

I think posts also should be done in Harbour developers group. Otherwise they wont see this messages.

Thanks
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: Migrating to Harbour

Postby hua » Wed Jan 14, 2015 12:27 pm

https://github.com/harbour/core/commit/ ... 0c94607f8f

2015-01-14 13:00 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* contrib/hbwin/olecore.c
+ added new PRG function to control empty date conversion to OLE variant:
__oleVariantNullDate( [<lNewNullFlag>] ) -> <lPrevNullFlag>
This is per thread switch and by default initialized to .F. for each
new thread. When set to .T. Harbour empty dates are translated to
VT_NULL.
Warning: it's possible that this function will be removed or replaced
by other solution in the future.
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: Migrating to Harbour

Postby Enrico Maria Giordano » Wed Jan 14, 2015 1:45 pm

Great! Antonio, can you give me the link to the new Harbour build so I can go on with my tests? :-)

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia


Re: Migrating to Harbour

Postby Antonio Linares » Thu Feb 05, 2015 5:33 am

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42206
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

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