Solved

How to open MS-Access 2.0 database using VB

Posted on 2002-05-19
6
229 Views
Last Modified: 2008-02-01
I have 1 access 2.0 database file which will used as main database of my simple program. I use VB 5.0.
I want to keep it's version, n dont want to convert the database to next versions.
When i try to open the xx.mdb file using office 97 and office2000, it shows error :

1. Record(s) cannot be read; no read permission on 'MSysObjects'.

then

2. Record(s) cannot be read; no read permission on 'MSysACEs'.

then
3. You can't make changes to the database objects in then database 'xxx.mdb'
   The database is created in an earlier version of Microsoft Access. Etc ......


I had tried to open it with excuslive open, and it didn't work.

When i use VB and ADO 2.5, is shows error (debug) :

Record(s) cannot be read; no read permission on 'YYYY'.

Note : YYYY is a table in that db.


Any pro can help me ?

0
Comment
Question by:BetaTest
6 Comments
 
LVL 1

Expert Comment

by:harsh008_k
ID: 7020820
hi beta,

There are two options
1)convert the database to latest version
2)Use odbc driver
   'write this code in vb
   dim cn as adodb.connection
   set cn=new adodb.connection
   cn.Open "dsn=dsnname;uid=;pwd=;"
   a)incase u want to make change to the database then    

    'u    have to change it to current version and then  
    ' make changes
0
 

Author Comment

by:BetaTest
ID: 7021021
Thx harsh008_k,

I found no difficulty to convert it into newer version.
I dont want to change it and want to keep it's version.

What makes me confused is :
i can open that db, although it shows warnings. BUT, when i checked it's password, but doesn't have it. Perhaps this version doesn't support password protected feature.
But when i open it using visual basic, it shows error :
no enough permission. Weird huh ??? :)
 
So any expert can help me ?


0
 
LVL 1

Expert Comment

by:harsh008_k
ID: 7021082
use odbc,dont use the password
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

Expert Comment

by:philipstewart
ID: 7026549
Try using the reference -- DAO 2.5/3.5 Compatability Library

If you only need to manipulate the db and never open it in MS Access this should work.

'Declarations
Global gstrInputDatabaseName As String
Global InputDataBase As Database

'Put in your form load event or wherever
gstrInputDatabaseName = "C:\YOUR_DB.mdb"

'Change the status of the input database from read-
'only, hidden, etc. to normal

SetAttr gstrInputDatabaseName, vbNormal
Set InputDataBase = Workspaces(0).OpenDatabase(gstrInputDatabaseName)

'Then perform your db calls


0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7817906
Hi BetaTest,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Save as PAQ -- No Refund.

BetaTest, Please DO NOT accept this comment as an answer.
EXPERTS: Post a comment if you are certain that an expert deserves credit.  Explain why.
==========
DanRollins -- EE database cleanup volunteer
0
 

Accepted Solution

by:
SpideyMod earned 0 total points
ID: 7909736
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA error replacing data 6 40
MS SQL store procedure to calculate and return result 6 62
Spell Check in VB6 13 126
Export PDF Form fields to Access  or Excel  in Tab order 16 77
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…

808 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