Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

error: unable to determine decimal


  • Please log in to reply

#1
Metallica

Metallica

    Spyware Veteran

  • GeekU Moderator
  • 33,101 posts
I'm trying to select a few columns from a dbf and I'm getting an error on a column where we have decimal values stored.

I think the problem is the values being stored with a "," to separate the decimals.
All I need is the rounded value anyway, but I don't know how to fetch it.

Dim dbfdatabase As String = "kmtab3.DBF"
		Dim connectionString As String = "Provider=VFPOLEDB.1;Data Source=\\Fileserver\iis\calculatiemodule\;"
		Dim ds As New DataSet
		Using connection As New OleDb.OleDbConnection(connectionString)
			Dim da As OleDb.OleDbDataAdapter
			Dim sql As String = "SELECT PLAATSVAN, PLAATSTOT, AFSTAND FROM " & dbfdatabase
			da = New OleDb.OleDbDataAdapter(sql, connection)
			da.Fill(ds, "Afstanden")
		End Using

The program errors on the Fill
System.InvalidOperationException was unhandled
Message= "The provider could not determine the Decimal value. For example, the row was just created, the default for the Decimal column was not available, and the consumer had not yet set a new Decimal value."


The "AFSTAND" values all have the format 146,00
which I can not change since another program (written in Vulcan) uses it as well.

Who knows a solution?
  • 0

Advertisements


#2
Metallica

Metallica

    Spyware Veteran

  • Topic Starter
  • GeekU Moderator
  • 33,101 posts
OK I found something weird. If I copy the dbf with PHP I can read the new copy with my VB.NET program.
It's a simple straight copy in my eyes, but it works.
for($i=1;$i<=$count;$i++) {
		 $row = dbase_get_record_with_names ($nixxer,$i);
$dossier[$i]=array($row['VOLGNUMMER'], $row['RELATIE'], $row['PLAATSVAN'], $row['PLAATSTOT'], $row['AFSTAND'], $row['D'], $row['F'], $row['A']);
		 }

Still I'd like to know what the difference is, because new records get added to the database all the time and I don't want to have to copy it everytime before I can use it.
  • 0

#3
Metallica

Metallica

    Spyware Veteran

  • Topic Starter
  • GeekU Moderator
  • 33,101 posts
One step closer. The problem lies in the Deleted records.

Now I'm looking for the option to skip the deleted records.

But as far as I understood this provider should skip them automatically.
Did I read that wrong?
  • 0

#4
Metallica

Metallica

    Spyware Veteran

  • Topic Starter
  • GeekU Moderator
  • 33,101 posts
I found a workaround by using a WHERE statement that is always true fior the records I want to read, so this matter is no longer urgent.
But of course I'm still curious.
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP