PC Review


Reply
Thread Tools Rate Thread

DBF Import Crashes .NET APP and no error log whatsoever

 
 
Henok Girma
Guest
Posts: n/a
 
      22nd Dec 2007
Hello,
I have the following code to connect and query a dbf file.

string cnn = @"Driver={Microsoft dBASE Driver
(*.dbf)};DriverID=277;Dbq=C:\DBF;exclusive=yes";
OdbcConnection odbcCnn = new OdbcConnection(cnn);
odbcCnn.Open();
OdbcCommand odbcCmd = odbcCnn.CreateCommand();
odbcCmd.CommandText = @"SELECT * FROM C:\DBF\Users.DBF";
OdbcDataReader reader =odbcCmd.ExecuteReader();
..
..
..
but at this point, the .net application crashes. I have the code surrounded
by try{} catch{} and even then the whole app crashes, there is no error
generated, no message, just the application vanishes. I'm at loss as to how
to troubleshoot this.

the same code works fine on my dev machine, but on some machine, I believe 2
separate machines, I have experienced what I just described.

where can i look for logged errors. does the .net framework log when .net
apps crash? there is no log in the windows event logs.

any help is greatly appreciated.

 
Reply With Quote
 
 
 
 
Henok Girma
Guest
Posts: n/a
 
      24th Dec 2007
anyone?

"Henok Girma" <(E-Mail Removed)> wrote in message
news:9DF139C6-F69E-48C4-B948-(E-Mail Removed)...
> Hello,
> I have the following code to connect and query a dbf file.
>
> string cnn = @"Driver={Microsoft dBASE Driver
> (*.dbf)};DriverID=277;Dbq=C:\DBF;exclusive=yes";
> OdbcConnection odbcCnn = new OdbcConnection(cnn);
> odbcCnn.Open();
> OdbcCommand odbcCmd = odbcCnn.CreateCommand();
> odbcCmd.CommandText = @"SELECT * FROM C:\DBF\Users.DBF";
> OdbcDataReader reader =odbcCmd.ExecuteReader();
> .
> .
> .
> but at this point, the .net application crashes. I have the code
> surrounded
> by try{} catch{} and even then the whole app crashes, there is no error
> generated, no message, just the application vanishes. I'm at loss as to
> how
> to troubleshoot this.
>
> the same code works fine on my dev machine, but on some machine, I believe
> 2
> separate machines, I have experienced what I just described.
>
> where can i look for logged errors. does the .net framework log when .net
> apps crash? there is no log in the windows event logs.
>
> any help is greatly appreciated.
>


 
Reply With Quote
 
Paul Clement
Guest
Posts: n/a
 
      24th Dec 2007
On Sat, 22 Dec 2007 08:17:25 -0500, "Henok Girma" <(E-Mail Removed)> wrote:

¤ Hello,
¤ I have the following code to connect and query a dbf file.
¤
¤ string cnn = @"Driver={Microsoft dBASE Driver
¤ (*.dbf)};DriverID=277;Dbq=C:\DBF;exclusive=yes";
¤ OdbcConnection odbcCnn = new OdbcConnection(cnn);
¤ odbcCnn.Open();
¤ OdbcCommand odbcCmd = odbcCnn.CreateCommand();
¤ odbcCmd.CommandText = @"SELECT * FROM C:\DBF\Users.DBF";
¤ OdbcDataReader reader =odbcCmd.ExecuteReader();
¤ .
¤ .
¤ .
¤ but at this point, the .net application crashes. I have the code surrounded
¤ by try{} catch{} and even then the whole app crashes, there is no error
¤ generated, no message, just the application vanishes. I'm at loss as to how
¤ to troubleshoot this.
¤
¤ the same code works fine on my dev machine, but on some machine, I believe 2
¤ separate machines, I have experienced what I just described.
¤
¤ where can i look for logged errors. does the .net framework log when .net
¤ apps crash? there is no log in the windows event logs.
¤
¤ any help is greatly appreciated.

Have you tried using Jet OLEDB and the dBase ISAM driver instead of the ODBC driver?


Paul
~~~~
Microsoft MVP (Visual Basic)
 
Reply With Quote
 
John Saunders [MVP]
Guest
Posts: n/a
 
      24th Dec 2007
"Henok Girma" <(E-Mail Removed)> wrote in message
news:9DF139C6-F69E-48C4-B948-(E-Mail Removed)...
> Hello,
> I have the following code to connect and query a dbf file.
>
> string cnn = @"Driver={Microsoft dBASE Driver
> (*.dbf)};DriverID=277;Dbq=C:\DBF;exclusive=yes";
> OdbcConnection odbcCnn = new OdbcConnection(cnn);
> odbcCnn.Open();
> OdbcCommand odbcCmd = odbcCnn.CreateCommand();
> odbcCmd.CommandText = @"SELECT * FROM C:\DBF\Users.DBF";
> OdbcDataReader reader =odbcCmd.ExecuteReader();
> .
> .
> .
> but at this point, the .net application crashes. I have the code
> surrounded
> by try{} catch{} and even then the whole app crashes, there is no error
> generated, no message, just the application vanishes. I'm at loss as to
> how
> to troubleshoot this.
>
> the same code works fine on my dev machine, but on some machine, I believe
> 2
> separate machines, I have experienced what I just described.
>
> where can i look for logged errors. does the .net framework log when .net
> apps crash? there is no log in the windows event logs.
>
> any help is greatly appreciated.


Please try surrounding the code with the following:

try
{
// Your code here
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
catch
{
Console.WriteLine("Unmanaged exception thrown!");
}
--
--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
no sound whatsoever =?Utf-8?B?T3Jpb24xOA==?= Microsoft Dot NET 2 11th Mar 2007 07:38 AM
No sound whatsoever Richard Sutter Windows Vista Hardware 1 17th Oct 2006 07:53 PM
no sound whatsoever perky Windows XP General 2 24th Jun 2006 07:39 PM
XP locks up for no reason whatsoever None Windows XP General 0 16th Sep 2004 03:22 AM
Re: No balls. None whatsoever. Virtual Valerie Freeware 0 20th Sep 2003 01:10 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:03 AM.