Solved

recompileing ADODB in D7

Posted on 2004-08-22
5
459 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

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…
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…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses
Course of the Month7 days, 1 hour left to enroll

623 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