473,739 Members | 4,265 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Strange Exception When Closing ODBC Connection to a Paradox Table

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 = "MySystemDn s";

StringBuilder connectionStrin g = new StringBuilder() ;

connectionStrin g.Append("MaxBu fferSize=2048;F IL=Paradox 5.X;");
connectionStrin g.AppendFormat( "DSN={0};", systemDnsName);

OdbcConnection connection = new OdbcConnection( connectionStrin g.ToString());

try
{
connection.Open ();
connection.Clos e();
}
catch(Exception e)
{
Console.WriteLi ne(e);
}

Console.WriteLi ne("All done...!");
Console.ReadLin e();
}

=============== =

Now, the connection.Open () line of code works correctly. However, when I hit
the connection.Clos e() 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.
Jul 21 '05 #1
0 1337

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1874
by: Nedelcho Stanev | last post by:
Hello All, I have strange problem with libodbc++ ( 0.2.3 or 0.2.2 ). i'm using mysql-4.0.14 , MyODBC-3.51.06 and unixODBC-2.2.6 configured with following options 1.MySQL ../configure --prefix=/usr/local/test --with-openssl --with-mysqld-user=root --enable-thread-safe-client --with-pthread --enable-shared
9
2205
by: Wescotte | last post by:
Here is a small sample program I wrote in PHP to help illustrates problem I'm having. The data base is using DB2 V5R3M0. The client is WinXP machine using the iSeries Client Access Driver ver 10.00.04.00 to connect to the database. The problem is that executing the exact same SQL select statement more than twice int a row stops produces results. The first two instances will always produce the correct results but after that it will simply...
0
1343
by: Zlatko Matić | last post by:
Hello. I created a login form that creates connection string (DSN-less) and starts procedure that connects to PostgreSQL server.I didn't know how to connect to server without performing anything so I managed that connection is established by executing a query that returns current_user...I have two questions regarding that issue: 1. Is it possible to establish ODBC connection without performing query, so that such connection is used for...
1
2494
by: Zlatko Matić | last post by:
Hi! In MS Access/PostgreSQL combination I have login form. After user writes all neccessary inputs and push the button, a startup procedure creates DSN-less connection string, receates all linked tables and change connection string in all pass-through queries. It works nice... But, how to achieve LOGOUT ? I would like to allow users to login/logout consecutively from MS Access front-end without need to close front-end. I tried to perform...
4
5022
by: Abhishek Srivastava | last post by:
Hello All, I wrote a program in which I have a OleDbConnection which I open in the contructor and close in the Destructor. When I run the program I get the following error Unhandled Exception: System.InvalidOperationException: Handle is not initialized .. at System.WeakReference.get_Target()
0
281
by: Steve Barker | last post by:
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: ================
0
3574
by: ivb | last post by:
Hi all, I am using DB2 8.1.11.1 on NT with ASP.NET 1.1 When application make connection to database (via ADO.NET), it set "Connection timeout" parameter to 30 seconds. After, when my webpage requests database, and query execution time exceeds 30 seconds, the following error reported: ===
5
3508
by: Jeff | last post by:
Okay, I'm still new to vb.net 2005 - throught this was a hardware problem, but now I don't know. (I'm having some problem with my newgroup provider, so hopefully this will go through) This problem just started about a week ago, before all was fine. I'm using the code below to access a mysql database. On the line indicated when the connection is opened, the application has been sporatically drawing an error. It doesn't occur very often -...
0
8969
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8792
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9479
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9337
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9266
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9209
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6754
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4826
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.