Solved

recompileing ADODB in D7

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to debug For loops? 3 49
control image tags in a string ? 12 131
tvirtualstringtree freeze when load too manny images 10 63
Base1 Encode/Decode 3 77
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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

777 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