Bug in ODBC.net Driver ??

Kaliffen

Member
Joined
Jan 21, 2003
Messages
5
Location
-
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
 
Does it throw an exception or just unpredictable results?

What does your Connection object look like?
 
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...
 
I dont have any experience with Paradox so this question may be naive... does Paradox support a Boolean that ADO.NET recognizes? I know that DB2 doesnt support a "bit" column like SQL Server - you must use a char(1) and interpret the value yourself.

-ner
 
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 projects data to access

/puff and out :-\
 
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
 
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
 
Back
Top