ADO using MS Access with mdw system database for pw-access 
Author Message
 ADO using MS Access with mdw system database for pw-access

In VB 6.0 I open the database Mybase.mdb using ADO. This is the connection
string:

Provider=Microsoft.Jet.OLEDB.3.51;
Data Source=C:\MyFolder\Mybase.MDB;
Persist Security Info=False;
User Id=MyUser;
Password=MyPW;
Jet OLEDB:System database=C:\Myfolder\Mysys.mdw;

The database is opened and everything seemes to be OK - but as soon as I
want to sve data into the database (new/edit) the program generates an error
telling me that the database is read-only...

This is the routine:
    Dim rec1 As ADODB.Recordset
    Dim cnn  As ADODB.Connection
    Dim sSQL As String

    sConn = "Provider... (see above)..."
    cnn.Open sConn
    sSQL = "SELECT * FROM mytable;"
    rec1.Open sSQL, cnn, adOpenStatic, adLockOptimistic
    rec1.AddNew

Anyone out there with a good idea???

Kjell Weding



Wed, 21 Sep 2005 00:22:20 GMT  
 ADO using MS Access with mdw system database for pw-access
Hi Kjell, CursorType =  adOpenStatic is read only, use CursorType =
adOpenDynamic or adOpenKeyset  if you want addnew or edit the recordset.

     rec1.Open sSQL, cnn, adOpenDynamic, adLockOptimistic

--
Vctor Koch From Argentina.



Quote:
> In VB 6.0 I open the database Mybase.mdb using ADO. This is the connection
> string:

> Provider=Microsoft.Jet.OLEDB.3.51;
> Data Source=C:\MyFolder\Mybase.MDB;
> Persist Security Info=False;
> User Id=MyUser;
> Password=MyPW;
> Jet OLEDB:System database=C:\Myfolder\Mysys.mdw;

> The database is opened and everything seemes to be OK - but as soon as I
> want to sve data into the database (new/edit) the program generates an
error
> telling me that the database is read-only...

> This is the routine:
>     Dim rec1 As ADODB.Recordset
>     Dim cnn  As ADODB.Connection
>     Dim sSQL As String

>     sConn = "Provider... (see above)..."
>     cnn.Open sConn
>     sSQL = "SELECT * FROM mytable;"
>     rec1.Open sSQL, cnn, adOpenStatic, adLockOptimistic
>     rec1.AddNew

> Anyone out there with a good idea???

> Kjell Weding



Wed, 21 Sep 2005 01:29:35 GMT  
 ADO using MS Access with mdw system database for pw-access
In the help file I find this about adOpenStatic: "Static cursor. A static
copy of a set of records that you can use to find data or generate reports.
Additions, changes, or deletions by other users are not visible." I thought
this might mean additions are possible, but other users of the database
won't see the update in real time. - Well I have changed it to
adOpenKeyset - BUT...:

Using adOpenKeyset I still get this error message:
Error number: -2147217911;  Can't update.  Database or object is read-only.

The database is not read-only; I have a DAO-vaersion of the same program,
accessing the same database - with no problems. But after converting the
program to ADO I cannot update the database anymore!

Kjell Weding



Quote:
> Hi Kjell, CursorType =  adOpenStatic is read only, use CursorType =
> adOpenDynamic or adOpenKeyset  if you want addnew or edit the recordset.

>      rec1.Open sSQL, cnn, adOpenDynamic, adLockOptimistic

> --
> Vctor Koch From Argentina.



> > In VB 6.0 I open the database Mybase.mdb using ADO. This is the
connection
> > string:

> > Provider=Microsoft.Jet.OLEDB.3.51;
> > Data Source=C:\MyFolder\Mybase.MDB;
> > Persist Security Info=False;
> > User Id=MyUser;
> > Password=MyPW;
> > Jet OLEDB:System database=C:\Myfolder\Mysys.mdw;

> > The database is opened and everything seemes to be OK - but as soon as I
> > want to sve data into the database (new/edit) the program generates an
> error
> > telling me that the database is read-only...

> > This is the routine:
> >     Dim rec1 As ADODB.Recordset
> >     Dim cnn  As ADODB.Connection
> >     Dim sSQL As String

> >     sConn = "Provider... (see above)..."
> >     cnn.Open sConn
> >     sSQL = "SELECT * FROM mytable;"
> >     rec1.Open sSQL, cnn, adOpenStatic, adLockOptimistic
> >     rec1.AddNew

> > Anyone out there with a good idea???

> > Kjell Weding



Wed, 21 Sep 2005 05:38:33 GMT  
 ADO using MS Access with mdw system database for pw-access
Hi Kjell

Quote:
> In the help file I find this about adOpenStatic: "Static cursor. A static
> copy of a set of records that you can use to find data or generate
reports.
> Additions, changes, or deletions by other users are not visible." I
thought
> this might mean additions are possible, but other users of the database
> won't see the update in real time.

This means that if you open a static recordset and other users on the LAN
open and update recordset you don't see the changes in your own recordset.

Error number: -2147217911

To resolve this problem, grant users the appropriate permissions.

--
Vctor Koch.



Quote:
> In the help file I find this about adOpenStatic: "Static cursor. A static
> copy of a set of records that you can use to find data or generate
reports.
> Additions, changes, or deletions by other users are not visible." I
thought
> this might mean additions are possible, but other users of the database
> won't see the update in real time. - Well I have changed it to
> adOpenKeyset - BUT...:

> Using adOpenKeyset I still get this error message:
> Error number: -2147217911;  Can't update.  Database or object is
read-only.

> The database is not read-only; I have a DAO-vaersion of the same program,
> accessing the same database - with no problems. But after converting the
> program to ADO I cannot update the database anymore!

> Kjell Weding



> > Hi Kjell, CursorType =  adOpenStatic is read only, use CursorType =
> > adOpenDynamic or adOpenKeyset  if you want addnew or edit the recordset.

> >      rec1.Open sSQL, cnn, adOpenDynamic, adLockOptimistic

> > --
> > Vctor Koch From Argentina.



> > > In VB 6.0 I open the database Mybase.mdb using ADO. This is the
> connection
> > > string:

> > > Provider=Microsoft.Jet.OLEDB.3.51;
> > > Data Source=C:\MyFolder\Mybase.MDB;
> > > Persist Security Info=False;
> > > User Id=MyUser;
> > > Password=MyPW;
> > > Jet OLEDB:System database=C:\Myfolder\Mysys.mdw;

> > > The database is opened and everything seemes to be OK - but as soon as
I
> > > want to sve data into the database (new/edit) the program generates an
> > error
> > > telling me that the database is read-only...

> > > This is the routine:
> > >     Dim rec1 As ADODB.Recordset
> > >     Dim cnn  As ADODB.Connection
> > >     Dim sSQL As String

> > >     sConn = "Provider... (see above)..."
> > >     cnn.Open sConn
> > >     sSQL = "SELECT * FROM mytable;"
> > >     rec1.Open sSQL, cnn, adOpenStatic, adLockOptimistic
> > >     rec1.AddNew

> > > Anyone out there with a good idea???

> > > Kjell Weding



Fri, 23 Sep 2005 21:57:22 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Ms Access Database w/PW - Hook to VB4 Data Control

2. Visual Basic Database and Access 97 System.mdw

3. Regarding Accessing External database using MS-Access and MS-Visual Basic

4. check permissions in the MS Access system database with ADO

5. how to create MS Access database using VB ADO

6. Accessign Rich Text in MS Access Database using ADO

7. Accessing Usernames in Ms Access 97 Using ADO

8. Using ADO to access MS Access

9. question reg. MS-Access database access using VB3

10. accessing MS access database using VB&CGI

11. Accessing Access with database level password using ADO

12. INFO: Avoiding the default system.mdw loss when re-registering Access 97

 

 
Powered by phpBB® Forum Software