Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB Currency datatype does not save Null-Value correctyl 1

Status
Not open for further replies.

ramsys

Programmer
Nov 13, 2002
6
DE
Hello,
we use VB6, SQL2000i SP4 and PervasiveOLEDB. In some databases we use the VB-Currency-Datatye (which is represented in the DDF-file as bigint, but changing it to "Currency" will make no difference).

In VB we have to calculate the data with 10000 (because VB stores this datatype with 4 decimals, SQL2000i stores it without decimals).

When saving the recordset, values <>0 are saved correctly. But if the value is zero then there are obscure values like 31877366 stored in our database. The VB-code is correct, we use the correct VBCurrency-datatype. Even after saving in my recordset there is the correct value &quot;0&quot;, but in PCC (or after reloading data from databse) we see that the wrong values are stored.

The problem does not occur with datatypes like double or single, but unfortunately we don't have the possibility to change our database, because there is a complex software in the background.

Can anybody help me?
Ronald Hoehn
RAMSYS Datensysteme GmbH
 
If it is a NULL issue then you could take a look at a white paper on the pervasive site entitled &quot;Pervasive.SQL 2000 Behavior with Legacy Nullable Columns&quot;

I only have it in hard copy :(
 
No sorry, it is not a really NULL-/NOTHING-Value, it is just &quot;0&quot;, zero, and so on.

I can save any number, only if the number is zero, it doesn't work!

Thank you
Ronald
 
Hello guys,

I found a workaround for my own problem, maybe this will help somebody. It's not very nice, but it works, and it is better than wrong values in my database:

If x <> 0 Then
Arti.Fields(&quot;OrderAmount&quot;).Value = x
Else
Arti.Fields(&quot;OrderAmount&quot;).Value = vbEmpty
End If

I don't understand the reason of this problem, but Pervasive sometimes goes strange ways...

Greetings
Ronald Hoehn
RAMSYS Datensysteme GmbH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top