Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

error: unable to determine decimal


  • Please log in to reply

#1
Metallica

Metallica

    Spyware Veteran

  • GeekU Moderator
  • 32,902 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
  • 32,902 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
  • 32,902 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
  • 32,902 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