Solved

vb6 error 3028

Posted on 2012-03-30
8
433 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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 Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

895 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

12 Experts available now in Live!

Get 1:1 Help Now