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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need help converting data from Btrieve 5 to Btrieve 6

Status
Not open for further replies.

jusan

Programmer
Mar 1, 2002
26
US
We are trying to convert data files from Btrieve 5.01(Basic) to Btrieve 6.15 for Windows (Visual Basic) and need a routine to convert single and double precision numbers to "Currency".

In the old Basic program, fields are defined as follows:
A Single precision field "4 as Field1$"
A double precision field "8 as Field2$"

We converted "Field1$" and "Field2$" inside the program with:
Amount=CVS(Field1$)
Amount#=CVD(Field2$)

In the Visual Basic program, we define the data field in the old file using "single" and "double" such as
OldAmount1 as Single
OldAmount2 as Double

In the Visual Basic program, we define the corresponding data fields in the new file as "currency"
NewAmount1 as Currency
NewAmount2 as Currency

When moving one amount to another we use
NewAmount1=Ccur(OldAmount1)
NewAmount2=Ccur(OldAmount2)

However, the results are that the NewAmount fields contains only zero(0) or we get an "overflow". We have tried to convert using Dbdl, Val and Str, but nothing works. Can you give us a routine or point us in the right direction.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top