Solved

recompileing ADODB in D7

Posted on 2004-08-22
5
455 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
ID: 11866435
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
ID: 11866439
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
ID: 11929616
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
ID: 11978781
PAQd, 65 points refunded.

GhostMod
Community Support Moderator
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

839 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