Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

recompileing ADODB in D7

Posted on 2004-08-22
5
Medium Priority
?
460 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

688 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