[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.odbcnet

Connecting to Faircom Db using ODBC.net

Paul Jefferies

7/22/2002 6:10:00 PM

My application uses an OdbcDataAdapter to access Faircom c-
tree db files. I succesfully carry out simple selects,
inserts, deletes and updates using OdbcDataAdapter
(SQLText, Connection) then fill a Dataset. But when I have
finished the updates and then open a new dialog form (i.e.
new myForm()) an Exception is thrown (ArithmeticException
in System.Drawing.dll).

I created an Access Db with the same data and structure
and it all ran with no exceptions. All the code was the
same, I just changed the DSN.

I also ran the same sequences of SQL statements in MS
Query with no errors being returned.

Anyone else out there using c-tree with .NET, or any ideas.
Will it be a problem with ODBC.Net and Faircom ODBC driver
compatabilty?

Thanks

Paul
Adastra Software Ltd
4 Answers

Tony

7/22/2002 8:45:00 PM

0

It doesn't appear to be a database problem, but a GUI problem instead since
the exception is from System.Drawing.dll.

Tony

"Paul Jefferies" <paul.jefferies@adastra.co.uk> wrote in message
news:1930c01c2319a$407e9f80$36ef2ecf@tkmsftngxa12...
> My application uses an OdbcDataAdapter to access Faircom c-
> tree db files. I succesfully carry out simple selects,
> inserts, deletes and updates using OdbcDataAdapter
> (SQLText, Connection) then fill a Dataset. But when I have
> finished the updates and then open a new dialog form (i.e.
> new myForm()) an Exception is thrown (ArithmeticException
> in System.Drawing.dll).
>
> I created an Access Db with the same data and structure
> and it all ran with no exceptions. All the code was the
> same, I just changed the DSN.
>
> I also ran the same sequences of SQL statements in MS
> Query with no errors being returned.
>
> Anyone else out there using c-tree with .NET, or any ideas.
> Will it be a problem with ODBC.Net and Faircom ODBC driver
> compatabilty?
>
> Thanks
>
> Paul
> Adastra Software Ltd


Paul Jeffeiries

7/23/2002 9:47:00 AM

0

It looked like that to me initially, but when I commented
out the data access functions it ran okay.
Then I just changed the DSN to point to an MS Access
replica of my database and it worked at treat.
If it was a GUI issue I would have expected the exception
to still appear.

Paul

Tony

7/23/2002 9:42:00 PM

0

I think I'd move the code to a console app and try it from there eliminating
the possibility all together.

Tony

"Paul Jeffeiries" <paul.jefferies@adastra.co.uk> wrote in message
news:196f801c2321d$212b6e50$37ef2ecf@TKMSFTNGXA13...
> It looked like that to me initially, but when I commented
> out the data access functions it ran okay.
> Then I just changed the DSN to point to an MS Access
> replica of my database and it worked at treat.
> If it was a GUI issue I would have expected the exception
> to still appear.
>
> Paul


Paul Jefferies

7/25/2002 1:28:00 PM

0

Problem solved. There is a bug in the System.Drawing.Font
constructor if Floating Point Unit exceptions are
enabled, which must be occurring in the Faircom ODBC
driver.

This Google link gives details:

http://groups.google.c...
hl=en&selm=JEyYFAG1BHA.1876%40cpmsftngxa07

I had to add this code to work around the bug:

Define the _controlfp method and the two integer in the
main Form class.

[DllImport("msvcrt.dll")]
private static extern int _controlfp(int IN_New, int
IN_Mask); private const int _MCW_EM = 0x0008001f; private
const int _EM_INVALID = 0x00000010;

Call the _controlfp method after I have finished the data
access function, to disable the FPU exceptions.

_controlfp(_MCW_EM, _EM_INVALID);

I don't know if this bug will be fixed in later .Net
Framework releases.

Paul