Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Working in vb.net, I am connecting to a Paradox 8.0 database trhough the odbc.net driver. Everything is working fine, But for all boolean fields. They seem to have no consistency in values whatsoever. Thus i get unpredictable results, that are NOT comming from the database.

 

I have testet this in the simplet enviroment possible (only one class, one method etc) and the error is still there

 

Any help would be very appreciated.

 

connString as string =

"Driver={Microsoft Paradox Driver (*.db )};" & _ "DriverID=538;" & _

"Fil=Paradox 8.X;" & _

"DefaultDir=" & dataSource & _

";Dbq=" & dataSource & _

";CollatingSequence=ASCII;" & _

"Uid=" & userid & ";Pwd=" & password & ";"

ODBCConnection = New OdbcConnection(ConnString)

 

When i do a select on a paradox 8 databse the boolean fields are random! no predictable sequence in them :confused:

 

The bug seems to be in the driver as a sqlConnection to a MsSql database with the SAME CODE AROUND IT do not produce the error.

Microsoft Visual Basic .NET 55537-640-4091527-18564

Posted

no exception

 

No it returns un predictable results.

 

I have written at testsuite in NUnit and it was this test suite that caught the boolean mistakes. Actually im kinda ed. because the error occurs out of my scope. When the dataadapter fx fills the dataset, the data is already corrupt. And yes im sure its the right database i have queried it myself.

 

some source:

 

in an button event handler---

 

Dim sqlString As String

Dim sqlComm As SqlCommand

Dim dr As SqlDataReader

Dim wheres As New Hashtable()

 

pool = ConnectionPool.getSingletonObject

Dim sqlconn As SqlConnection = pool.getSqlConnection("lopis", "localhost", "sa", "")

 

Dim provider As New SqlProvider()

 

wheres.Clear()

wheres.Add("BoreHoleID", "50")

 

'' the sql provider generates sql for us "select * where..."

sqlString = provider.getSelectSql("BoreHole", wheres)

sqlComm = New SqlCommand(sqlString, sqlconn)

'' actually execute the query

sqlconn.Open()

 

dr = sqlComm.ExecuteReader()

dr.Read()

 

'' GAH THIS VALUE IS RANDOM?!?!?!

MsgBox(dr.GetBoolean(17))

 

end sub

 

'' some source from connection pool ''

 

 

Public Function getSqlConnection(ByVal dataSource As String, ByVal ip As String, ByVal userid As String, ByVal password As String) As SqlConnection

Dim myConnString As String

myConnString = "server=" & ip & ";database=" & dataSource & ";User id=" & userid & ";password=" & password & ";"

Dim myConnSql As New SqlConnection(myConnString)

Return myConnSql

End Function

 

 

(dont mind line brakes)

 

im pretty sure is the driver that bug me.

 

Any alternatives to ODBC.net in connecting to paradox 8 ?!?!?!

 

really need help here...

  • *Experts*
Posted

I don't have any experience with Paradox so this question may be naive... does Paradox support a Boolean that ADO.NET recognizes? I know that DB2 doesn't support a "bit" column like SQL Server - you must use a char(1) and interpret the value yourself.

 

-ner

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted

no go!

 

well the paradox system has a Logical field (L) which is nothing more than a bit.

 

when i get more time i will mess with the code and maybe make an article on the subject... anyhow paradox 8 and odbc.net is not recommended together

 

I might have to port the entire project's data to access

 

/puff and out :-\

Posted

its the driver (from hell)

 

well now i have ported the code to work with access trough the SAME ODBC driver!!! this works perfect.

 

I guess microsoft dident want to support paradox at all in their new smartypants framework. sucky!

 

Well theres is always a tradeoff.

 

bottomline do not expect .net to work with paradox 7-8-9

  • *Experts*
Posted

Have you seen this set of articles from Microsoft? I saw a piece talking about datatypes in Paradox and how they map in .NET. I didn't read too far but it might be useful.

 

-Nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted

coo!

 

thx man.

 

It dident solve the problem, but is the first REAL HELP i have gotten i the matter.

 

One the articles states that the logical field is mapped to at sql bit but this is only valid for paradox 5.x & 4.x

 

At least now i KNOW there is a driver problem, and doesent have to worry about my code

 

goodie....

 

/me closing subject

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...