Link to home
Start Free TrialLog in
Avatar of ttobin333
ttobin333

asked on

vb6 error 3028

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!
Avatar of kaufmed
kaufmed
Flag of United States of America image

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.
Avatar of ttobin333
ttobin333

ASKER

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.
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
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.
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...
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.
ASKER CERTIFIED SOLUTION
Avatar of ttobin333
ttobin333

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
As stated in comment.