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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

strange problem: openrecordset

Status
Not open for further replies.

VBmim

Programmer
Jun 25, 2001
361
BE
Hello

We have a small vb program that used to work with an access97 database. We upgrated this database to an access2000 database (it was about time :) ).

With access97, our program used dao 3.51 and worked fine. The access2000 needed another version of dao (3.6).

Now I have a very strange problem with the openrecordset command... Here is my code

Code:
dim db2 As dao.Database
dim rs2 As dao.Recordset
dim ws As Workspace

Set ws = DBEngine.Workspaces(0)

Set db2 = ws.OpenDatabase("\\NETWORKSHARE\SOMEFOLDER", False, False, "Text;")
Set rs2 = db2.OpenRecordset("somefile.rit") 'here is the error

The error I get is: 3027 (can't update database or object is read-only)
somefile.rit has a text-format

This code worked fine with dao 3.51.

What I noticed (and found to be strange) was: When you change the file name to 'somefile.txt', there is no error anymore.

Does anyone has an explanation or a solution for this problem?

Greetz

VBmim
 
This is a Windows safeguard, to prevent system files from being edited with the JET ISAME Driver since JET 4 SP 3, and you can only do this (open a file with the the JET ISAM Text driver) with certain file extensions: txt,csv,tab,asc

You will need to rename the file at run time - simple as that.

Or Edit the registry key: DisabledExtensions, under
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Text
 
hello cllint!

Thanks for your fast response... Renaming the file is not a big problem (actually, that part of the problem is already 'solved')

Greetz

VBmim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top