Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "KOL";
Текущий архив: 2004.07.25;
Скачать: [xml.tar.bz2];

Вниз

Проблема с KOLEdb   Найти похожие ветки 

 
Ricko ©   (2004-01-23 13:46) [0]

База данных MS SQL Server; поле ID; формат MONEY; значение 98000060023. Использую KOLEdb:
id:=QR.RFieldByName["ID"];
Получаю значение 73243.2496. Почему так?


 
Ricko ©   (2004-02-24 16:35) [1]

А если вот так:
var id : int64;
id:=QR.LFieldByName["ID"]

То получаем 980000600230000.
Что делать? Помогите.


 
Владимир Кладов   (2004-02-24 20:21) [2]

Ну и чем второе решение не устраивает? Значение же верное возвращается. Или надо что-то другое чтобы получалось?


 
Boguslaw   (2004-02-24 21:32) [3]

By the way Vladimir ,could You add this two useful procedures to KOlOleDB

ShowLastOleError is for case when error should be shown only sometimes .
DummyOleError is replacement of old one which show OLE DB error description (which is hardly to find in docs so it nice feature)

I could also send You my all file but I;m not sure that I have the newest version modified.

Boguslaw Brandys

procedure ShowLastOleError;
var
hr : HRESULT;
pIErrorInfo : IErrorInfo;
Source,Description : WideString;
begin
 hr := GetErrorInfo(0,pIErrorInfo);
       // We"ve got the IErrorInfo interface pointer on the Error object
       if (hr = 0) then
       begin
           pIErrorInfo.GetSource(Source);
           pIErrorInfo.GetDescription(Description);
       end;
//    if Assigned(pIErrorInfo) then  pIErrorInfo._Release;
   ShowMsg("OLE DB error " + " [" + Source + "] " + Description,mb_iconhand);
end;

procedure DummyOleError( Result: HResult );
var
HR : HRESULT;
pIErrorInfo : IErrorInfo;
Source,Description : WideString;
begin
 hr := GetErrorInfo(0,pIErrorInfo);
       // We"ve got the IErrorInfo interface pointer on the Error object
       if (hr = 0) then
       begin
           pIErrorInfo.GetSource(Source);
           pIErrorInfo.GetDescription(Description);
       end;
//    if Assigned(pIErrorInfo) then  pIErrorInfo._Release;
   ShowMsg( "OLE DB error " + Int2Hex( Result, 8 ) + " [" + Source + "] " + Description,mb_iconhand);
   Halt;
end;


 
Ricko ©   (2004-02-25 09:43) [4]

Разве 980000600230000 = 98000060023 ?


 
Владимир Кладов   (2004-02-25 15:14) [5]

CURRENCY

A data type that is useful for calculations involving money or for fixed-point calculations in which accuracy is extremely important. This data type is used to store numbers with up to 15 digits to the left of the decimal point and 4 digits to the right. Because the Currency data type uses discrete values for all amounts, binary round-off isn’t a factor when calculating totals.

Ну  и все. Trunc( Result/100 ) / 100 = вот вам и деньги.



Страницы: 1 вся ветка

Форум: "KOL";
Текущий архив: 2004.07.25;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.46 MB
Время: 0.037 c
10-1023374714
Алексей Черменов
2002-06-06 18:45
2004.07.25
Построение КИС на основе технологии EJB


14-1088701331
DeadMeat
2004-07-01 21:02
2004.07.25
Письмо


14-1088686545
WondeRu
2004-07-01 16:55
2004.07.25
Годовщина!


14-1087572498
Nic
2004-06-18 19:28
2004.07.25
Демографическая катастрафа в России :(


3-1088411079
TL
2004-06-28 12:24
2004.07.25
InterBase





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский