Solved

vb6 error 3028

Posted on 2012-03-30
8
434 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
  • 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

832 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