Solved

vb6 error 3028

Posted on 2012-03-30
8
431 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 74

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
 
LVL 74

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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now