Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB 6.0 3170 Error

Status
Not open for further replies.

tommyc7

Programmer
Feb 3, 2007
33
US
Hello. I just inherited a program written in Visual Basic 6 which connects to a MS Access data base. I have Access version 2003 installed on my PC. I'm not sure what version the DB was originally created in (don't know how to find out).

In production, the DB is on a shared drive and the VB program is on the PC -- it works fine like that on my PC.

I am trying to set up a development environment, using a local version of the DB and running the program from the VB IDE.

Without a single code change, on my local PC I get the following error: "Error 3170: Counldn't find installable ISAM."

I found a few references to this on the web that talk about doing something in the registry, but they're pretty vague on what I'm actually supposed to do. And also, if it were a registry issue, wouldn't I have the same problem accessing the DB on the shared drive?

Does anyone have any ideas?


Here's the code:
Code:
Private Sub Form_Initialize()
    On Error GoTo errHandle
    Dim tempStr As String
    
    FirstTimeUser = False
    dataContacts.DatabaseName = DBPath
    dataContacts.RecordSource = "select * from contacts"
    dataContacts.Refresh

    'Get the user ID from a text file.  If the file doesn't exist then create it.
    Open App.Path & "\UserID.txt" For Input As #1
        Input #1, tempStr
    Close #1
    txtUserID = tempStr
    Exit Sub
    
errHandle:
    If Err.Number = 53 Then
        FirstTimeUser = True
    Else
        MsgBox "Error " & Err.Number & ":  " & Err.Description
    
        Stop
    End If
End Sub

Thanks,
Tom

 
Somewhere in your program you must be setting a value for the variable [blue]DBPath[/blue]. If you have moved or made a copy of the database but you have not changed DBPath to point to it then you may get a variety of messages ... one of which is the one you're seeing.
 
It looks like you may be trying to access a Jet Red 3 mdb.

"dataContacts" is probably a DAO DataControl object on the form (an object with two navigation arrows). Find it and click on it.
In the properties window for that control you will see a connect property.

If it says "Access 2000", then it is using DAO 3.6 and JET 4.0, and is not the problem that I am thinking of.

If it just says "Access", then it is trying to use DAO 3.5 and Jet 3.5.
This is probably not installed on your machine correctly. Then you will get this error.
You would also get it if it is using some other connection, or an ODBC DSN, which is not installed on the machine.

You can also debug this:

?dataContacts.Database.Version

See if you can select "Access 2000".
If not, then update to VB6 SP6.
If you can change it to "Access 2000", then do so and see if it works.
If it does work, then you need to consider upsizing the Mdb to Access 2000+, or installing the DAO 3.5 and Jet 3.5 drivers. If you don't, you may sooner or later get some corruptions in a multi-user environment.
 
>You can also debug this:
>?dataContacts.Database.Version

Well, I guess you cannot, if you cannot even connect to it. ;-)
 
Thank you Golom and SBerthold for your advice. Unfortunately, I am still having the issue.

Golom -- The program gets the DBPath from a config (text) file. When I debug the code, I see the correct path.

SBerthold -- The DataControl object does say "Access 2000". I see where you going with your train of thought, but if it were something that wasn't installed properly or wrong versions or something, then I believe I'd have the same problem connecting to the copy of the DB on the shared drive.

I am using the exact same code and the exact same database on the same PC. There are only 2 differences that I can think of. 1) I am running the code from the IDE rather than the .EXE. 2) I copied the database from a network drive to my local hard drive (and updated the configuration file to point to the new location). I am not an experienced VB or Access programmer, so I'm obviously missing some subtle point, but this seems strange to me.

Thanks,
Tom



 

Yes, but then is there a value set for DatabaseName in the properties window, which needs to be removed? It will use this, first, even if you are also setting it in code.

Also, just what is the actual value of DBPath?

And, just what is in this "configuration file" which you have updated?
 
Thank you so much for your continued help!

I have a new piece of information -- I don't know why I didn't think to try this before, but I compiled a new EXE file and replaced the version that "works" and tried both databases. I can connect to both of them fine. Then I tried to connect to both of them through the IDE, and I cannot connect to either of them. The problem ONLY occurs through the IDE.

So, I guess I'm OK unless I need to use the debugger.

SBerthold, to answer your specific questions.

1. The DatabaseName field is blank.

2. The answers to both of you second questions is:
D:\DRS\CCSys00.mdb

That is the entire contents of the config file and the absolute path to the DB.


Thanks again!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top