Kaliffen Posted January 21, 2003 Posted January 21, 2003 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 Quote
Moderators Robby Posted January 21, 2003 Moderators Posted January 21, 2003 Does it throw an exception or just unpredictable results? What does your Connection object look like? Quote Visit...Bassic Software
Kaliffen Posted January 22, 2003 Author Posted January 22, 2003 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... Quote
*Experts* Nerseus Posted January 22, 2003 *Experts* Posted January 22, 2003 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 Quote "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
Kaliffen Posted January 24, 2003 Author Posted January 24, 2003 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 :-\ Quote
Kaliffen Posted January 29, 2003 Author Posted January 29, 2003 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 Quote
*Experts* Nerseus Posted January 29, 2003 *Experts* Posted January 29, 2003 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 Quote "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
Kaliffen Posted January 30, 2003 Author Posted January 30, 2003 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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.