472,325 Members | 2,310 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,325 software developers and data experts.

OpenFileDialog and ADO.NET

VS.NET 2002 and 2003 are installed.
..NET Framework 1.0 and 1.1 installed
Program running under VisualBasic.NET 2002 with .NET Framwork 1.0
I am experiencing a problem with ADO.NET where the Connection object
(OleDBConnection) will not Open (conIncident.Open) given the following
situation:

1. Program is loaded and connection is established to Access database on C:
2. Able to manipulate and view the data in the database with no problems
3. Use the OpenFileDialog to select a file in A: from which to merge data
to the database on C: (The file on A: is a text file which is parsed to
merge data into the database on C:)
4. After the merge, remove the Floppy disk from A:
5. Now, whenever I try to perform an operation on the database, I get the
following error message: "Disk or network error. Microsoft JET Database
Engine"
6. If I insert the disk, then I am able to perform database operations on
C: with no problems, except that it keeps checking A: for a disk.
Other things that I found include:

A) If I select a file in A: using the OpenFileDialog, hit OK to select the
file, then do NOT perform the merge operation, I still get the error.

B) If I select a file in A: using the OpenFileDialog then hit Cancel, the
error will not appear.

C) If I do not use the OpenFileDialog and hardcode the path to A: and
perform the merge with this, then I will not get any errors.
Given what I have found so far, there appears to be a problem with the
OpenFileDialog and Access database programming with ADO.NET. Has anybody
experienced this type of bevavior before, and if so, is there a solution?

Thanks,
Jody
Jul 21 '05 #1
3 2894
Hi Jody,

How do you read the data from A:? Do you close the stream?

--
Miha Markic - RightHand .NET consulting & development
miha at rthand com
www.rhand.com

"Jody Gelowitz" <jo**@mail.visualstatement.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
VS.NET 2002 and 2003 are installed.
.NET Framework 1.0 and 1.1 installed
Program running under VisualBasic.NET 2002 with .NET Framwork 1.0
I am experiencing a problem with ADO.NET where the Connection object
(OleDBConnection) will not Open (conIncident.Open) given the following
situation:

1. Program is loaded and connection is established to Access database on C: 2. Able to manipulate and view the data in the database with no problems
3. Use the OpenFileDialog to select a file in A: from which to merge data
to the database on C: (The file on A: is a text file which is parsed to
merge data into the database on C:)
4. After the merge, remove the Floppy disk from A:
5. Now, whenever I try to perform an operation on the database, I get the
following error message: "Disk or network error. Microsoft JET Database
Engine"
6. If I insert the disk, then I am able to perform database operations on
C: with no problems, except that it keeps checking A: for a disk.
Other things that I found include:

A) If I select a file in A: using the OpenFileDialog, hit OK to select the file, then do NOT perform the merge operation, I still get the error.

B) If I select a file in A: using the OpenFileDialog then hit Cancel, the
error will not appear.

C) If I do not use the OpenFileDialog and hardcode the path to A: and
perform the merge with this, then I will not get any errors.
Given what I have found so far, there appears to be a problem with the
OpenFileDialog and Access database programming with ADO.NET. Has anybody
experienced this type of bevavior before, and if so, is there a solution?

Thanks,
Jody

Jul 21 '05 #2
"Jody Gelowitz" <jo**@mail.visualstatement.com> wrote in
news:#5**************@TK2MSFTNGP12.phx.gbl:
VS.NET 2002 and 2003 are installed.
.NET Framework 1.0 and 1.1 installed
Program running under VisualBasic.NET 2002 with .NET Framwork
1.0
I am experiencing a problem with ADO.NET where the Connection
object (OleDBConnection) will not Open (conIncident.Open) given
the following situation:

1. Program is loaded and connection is established to Access
database on C: 2. Able to manipulate and view the data in the
database with no problems 3. Use the OpenFileDialog to select a
file in A: from which to merge data to the database on C: (The
file on A: is a text file which is parsed to merge data into the
database on C:) 4. After the merge, remove the Floppy disk from
A: 5. Now, whenever I try to perform an operation on the
database, I get the following error message: "Disk or network
error. Microsoft JET Database Engine"
6. If I insert the disk, then I am able to perform database
operations on C: with no problems, except that it keeps checking
A: for a disk.
Other things that I found include:

A) If I select a file in A: using the OpenFileDialog, hit OK to
select the file, then do NOT perform the merge operation, I
still get the error.

B) If I select a file in A: using the OpenFileDialog then hit
Cancel, the error will not appear.

C) If I do not use the OpenFileDialog and hardcode the path to
A: and perform the merge with this, then I will not get any
errors.
Given what I have found so far, there appears to be a problem
with the OpenFileDialog and Access database programming with
ADO.NET. Has anybody experienced this type of bevavior before,
and if so, is there a solution?


Jody,

By default, OpenFileDialog changes the current directory when a file
is selected. Set the dialog's RestoreDirectory to true to avoid this
behavior.

Hope this helps.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/
Jul 21 '05 #3
Thanks.

Setting RestoreDirectory = True fixed the problem.

Jody

"Chris R. Timmons" <crtimmons@X_NOSPAM_Xcrtimmonsinc.com> wrote in message
news:Xn**********************************@207.46.2 48.16...
"Jody Gelowitz" <jo**@mail.visualstatement.com> wrote in
news:#5**************@TK2MSFTNGP12.phx.gbl:
VS.NET 2002 and 2003 are installed.
.NET Framework 1.0 and 1.1 installed
Program running under VisualBasic.NET 2002 with .NET Framwork
1.0
I am experiencing a problem with ADO.NET where the Connection
object (OleDBConnection) will not Open (conIncident.Open) given
the following situation:

1. Program is loaded and connection is established to Access
database on C: 2. Able to manipulate and view the data in the
database with no problems 3. Use the OpenFileDialog to select a
file in A: from which to merge data to the database on C: (The
file on A: is a text file which is parsed to merge data into the
database on C:) 4. After the merge, remove the Floppy disk from
A: 5. Now, whenever I try to perform an operation on the
database, I get the following error message: "Disk or network
error. Microsoft JET Database Engine"
6. If I insert the disk, then I am able to perform database
operations on C: with no problems, except that it keeps checking
A: for a disk.
Other things that I found include:

A) If I select a file in A: using the OpenFileDialog, hit OK to
select the file, then do NOT perform the merge operation, I
still get the error.

B) If I select a file in A: using the OpenFileDialog then hit
Cancel, the error will not appear.

C) If I do not use the OpenFileDialog and hardcode the path to
A: and perform the merge with this, then I will not get any
errors.
Given what I have found so far, there appears to be a problem
with the OpenFileDialog and Access database programming with
ADO.NET. Has anybody experienced this type of bevavior before,
and if so, is there a solution?


Jody,

By default, OpenFileDialog changes the current directory when a file
is selected. Set the dialog's RestoreDirectory to true to avoid this
behavior.

Hope this helps.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/

Jul 21 '05 #4

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

Similar topics

3
by: bobrad | last post by:
MAYBE SOMEBODY CAM HELP I AM USING THE FOLLOWING CODE TO GET A LOCATION OF A FILE IN A WINFORM DIALOG OpenFileDialog openFileDialog = new...
2
by: don | last post by:
has anyone experienced problems with interactions between OpenFileDialog and FileStream? When I select "open" from an OpenFileDialog the subsequent...
4
by: Nagachandra Sekhar Grandhi | last post by:
I am facing a problem with OpenFileDialog. It is as follows. I opened OpenFileDialog dialog box and selected a folder in it. After selecting the...
8
by: e-mid | last post by:
why does not openFileDialog have closed event? i want to do something; as soon as the dialog closes. is there a way to do this?
6
by: barbara_dave | last post by:
Hi, All, I want to use the openfiledialog to open different extension files in different directory( only one type files at one time). I set the...
8
by: marcus.kwok | last post by:
I am having a weird problem and I have can't figure out why it is happening. I create an OpenFileDialog and set a filename filter. When the...
1
by: sam | last post by:
OpenFileDialog appears to be "holding onto" the parent folder of a selected file until the application using the dialog quits. After creating a...
3
by: Martijn Mulder | last post by:
It strikes me that System.Windows.Forms.OpenFileDialog seems te 'remember' which directory it was in last, even when a new OpenFileDialog-object is...
0
by: mbewers1 | last post by:
Hi I'm having a problem trying to get a customised OpenFileDialog() to fulfil my requirements. The code for this custom-built dialog has been...
0
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
0
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...

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.