Solved

vb6 error 3028

Posted on 2012-03-30
8
438 Views
Last Modified: 2012-04-09
Dear Experts,

I'm getting error 3028 when starting my application, and it is somehow related to a richtextbox on the main form. Here is the scenario:

If I load an RTF file from a USB memory stick into the richtextbox, close my application, and remove the USB stick, the next time I start the application I get the 3028 error.  If I start again with the USB stick reconnected, it open with no error.

The last RTF file that was in the richtextbox is NOT automatically loaded on  startup.

Why does the application care if a previously accessed file's drive is no longer connected? What am I missing here?

Thanks!
0
Comment
Question by:ttobin333
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
8 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 37789093
How are you accessing the drive? If you hard-code something like "E:\someFolder\someFile.txt" into your application, and "E:" was not connected to anything, then certainly "someFolder" (and trivially "someFile") would not exist. The drive containing those objects is not attached to anything. In this case, you would get an error regarding not being able to locate the folder/file.
0
 

Author Comment

by:ttobin333
ID: 37789168
Thanks.  I am accessing the drive using the OpenFile CommonDialog. Drive is not hard-coded. This only happens if a file from the USB was opened during the last session.
0
 
LVL 16

Expert Comment

by:HooKooDooKu
ID: 37789205
It sounds like the OpenFile CommonDialog is attempting to access the last drive it was connected to.  But I can't find 3028 to be a Common Dialog box error.  Instead, when I google that error number, it is usually associated with database access (such as DAO), such as not having valid credentials when you attempt to create a workspace.

Do you have any DB logic that might be attempting to access the drive?

Sounds like
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 37789206
I believe the dialog "remembers" the last folder that was opened. You might try resetting the target path to a known folder on application start.
0
 

Author Comment

by:ttobin333
ID: 37789630
Thanks guys.

The application uses a DAO database to load other controls,  but there is no reference to the last drive accessed by the richtextbox, which is not database connected.

The error occurs when the application is starting up, before trying to load the richtextbox, so the commondialog file open should not be coming into play yet.

Nevertheless, I will examine carefully for possible connections...
0
 

Author Comment

by:ttobin333
ID: 37794077
Not having any success with this...any other ideas?

Although there is no code referencing the DAO database during the process of loading an RTF file into a RichTextBox from an external drive, this seems to somehow make it impossible to open the database if the external drive is not connected the next time the application is started.
0
 

Accepted Solution

by:
ttobin333 earned 0 total points
ID: 37794277
After a lot of experimentation and trying every possible intervention, I figured this out.  Turns out, thus only occurs when running the application within the VB6 IDE and not with the compiled exe.  

Apparently a VB6 quirk/bug.
0
 

Author Closing Comment

by:ttobin333
ID: 37822798
As stated in comment.
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question