Solved

recompileing ADODB in D7

Posted on 2004-08-22
5
443 Views
Last Modified: 2010-04-16
PROBLEM:
I am using a tAdoQuery to connect to a FOX db. All the integer(decimals in fox) results are returned as pozitive values even if they are negative(ex: -1 becomes 1). I have looked on google for "negative numbers tadoquery" and I have come across a quality central article which says: "Negative Decimals show as positive using ADO".
Full article #2379:
"Decimal columns in SQL Server which contain negative values are displayed as positive values by Delphi's ADO componenents.

This occurs when the decimal column has a numeric scale of 0 and a precision < 10. e.g. decimal(3,0). Such columns are created as TIntegerFields in Delphi, but the sign is lost when reading the field's value. This occurs in both D6 and D7 (but not D5).

The problem is in VarToBuffer in ADODB.pas in the following line (line 4222):
ftAutoInc, ftInteger:
Integer(Buffer^) := lVal;

Vassil Nazarov has suggested the following fix:
ftAutoInc, ftInteger:
If (vt=VT_DECIMAL)And(tagDEC(Data).sign>0) Then // 05.SEP.2002 - Deal with DECIMAL(x.0) here.
Integer(Buffer^):=-1*lVal
Else
Integer(Buffer^):=lVal;

Additional note:
This bug appears very similar to bug #998 where negative bigint columns show as positive, but these are actually two different bugs, with the problems being on different lines within VarToBuffer in ADODB.pas."

I cannot apply the fix because it doesn't seem to recompile ADODB. Through debugger I saw that it doesn't pass my newly addes lines but the old ones(even if they are commented!!!). Look at this:
{ OLD LINES COMENTED:
ftAutoInc, ftInteger: // it passes trough here
Integer(Buffer^) := lVal; // and here, very strange
}// NEW LINES
If (vt=VT_DECIMAL)And(tagDEC(Data).sign>0) Then // 05.SEP.2002 - Deal with DECIMAL(x.0) here.
Integer(Buffer^):=-1*lVal
Else
Integer(Buffer^):=lVal;
0
Comment
Question by:xtremecris
  • 2
5 Comments
 
LVL 13

Expert Comment

by:BlackTigerX
Comment Utility
after you make the changes
delete the adodb.dcu from
C:\Program Files\Borland\Delphi7\Lib
and
C:\Program Files\Borland\Delphi7\Lib\debug

then click on Delphi menu Project,  Build [Project Name]
0
 
LVL 13

Expert Comment

by:BlackTigerX
Comment Utility
if that still doesn't work copy the adodb.pas to the directory where you have your project and then to the Project, Build Project
0
 
LVL 1

Author Comment

by:xtremecris
Comment Utility
Nothing works... it seems that there is no solution. You cannont recompile adodb.bpl.

I will ask for my points back.
0
 
LVL 1

Accepted Solution

by:
GhostMod earned 0 total points
Comment Utility
PAQd, 65 points refunded.

GhostMod
Community Support Moderator
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now