Hi guys,
I've written an application in C# that connects to a Paradox table via ODBC.
My code has always worked fine, but now I've moved my application to another
machine, it's stopped working! However, the way in which it has stopped
working is very strange.
Here is an example program that demonstrates my problem:
================
static void Main(string[] args)
{
string systemDnsName = "MySystemDns";
StringBuilder connectionString = new StringBuilder();
connectionString.Append("MaxBufferSize=2048;FIL=Pa radox 5.X;");
connectionString.AppendFormat("DSN={0};", systemDnsName);
OdbcConnection connection = new OdbcConnection(connectionString.ToString());
try
{
connection.Open();
connection.Close();
}
catch(Exception e)
{
Console.WriteLine(e);
}
Console.WriteLine("All done...!");
Console.ReadLine();
}
================
Now, the connection.Open() line of code works correctly. However, when I hit
the connection.Close() statement while debugging, something goes wrong: the
application dies and closes, completely ignoring the error handling code I've
written. "All done...!" never appears on the screen. I get no error message
or anything: the thing just shuts down completely. It's all the more
frustrating that the connection opens OK; there's nothing wrong with the ODBC
connection that I can find!
I'm completely baffled! Has anyone else ever had a similar problem to this?
Thanks in advance for your help,
Steve.