Access2k vba, dataaccess doesn't work

  • Thread starter Thread starter Martin
  • Start date Start date
M

Martin

Hi,
I have following problems with Access 2k.

1 - sometimes, I can't use the recordset object (or recordsetclone property)
of a form to search or manipulate data.
1: dim rs as dao.recordset
2: set rs = me.Recordsetclone
3: rs.findfirst .....
at line 2 I receive an error, "the user XX of computer YY opened the
database ddd and set the status ..., that you can manipulate..."

2 - Sometimes, I open a form in design modus in order to change it. Access
tells me "you have no exclusive access on the database, ... you won't be
able to save the changes..."

why must I open the database in exclusive modus, when I am the only
person, who access to the database?

That is unnormal, is that? Is there any bug or security problem?

Thanks for any help
Martin
 
Hi Martin,

It is normal that exclusive mode is required to make any design changes. Is
your database on your local hard drive, or is this a shared database on a
network file server? If it is shared, it should be split into two .mdb
files: a front-end (FE) and a back-end (BE). Only the BE file should be
shared; each user should have their own copy of the FE application on their
local hard drive. Here is more information on the topic of splitting a
database, in case this is a shared application:

http://home.bendbroadband.com/conradsystems/accessjunkie/splitting.html

The reason I bring this up is because it is possible that you have a locking
database file that was not properly deleted the last time the database was
closed. With Access closed, verify that you do not see a file with the same
name, but with the .ldb file extension. You may need to configure Windows to
unhide file extensions for known file types. The .ldb file is usually about 1
KB in size. If you see this file hanging around, try deleting it.

Introduction to .ldb Files
http://support.microsoft.com/?id=299373


Tom

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
 
Hi Tom,

I did worked much with access, I have never seen such a Problem.
My DB is not shared on network, I am the only user each time.

This reason, I think, can explain only why I cannot open a form in
designmode (but the DB is not shared). I have tried to split it to front end
und BE, but that doesn't help.

With the code
1: dim rs as dao.recordset
2: set rs = me.Recordsetclone
3: rs.findfirst .....
at line 2, when access brings error message, I click on "stop" to stop the
code, later this error doesn't occurs any more. Why???

Can Service pack 2 of Windows XP be the problem. Earlier I didn't have this
problem.

I have also tried to create new database, import all objects ... But it
doesn't help.

Martin
 
Hi Martin,
My DB is not shared on network, I am the only user each time.

Okay, but my comment about verifying that you do not have a left over
locking database file when you have the database closed still applies.
I have tried to split it to front end und BE, but that doesn't help.

Splitting a single-user database is optional, however, it is imperitive to
split a multi-user database (if you want to eliminate unnecessary risk of
corruption).

Your code looks very similar to that written by the combo box wizard, using
the 3rd choice, to find a record based on a selection. The only difference
that I see off-hand is that the wizard declares the recordset as an object.
Here is an example of wizard-written code in Access 2002 (SP-3):

Private Sub Combo48_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[CustomerID] = '" & Me![Combo48] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub


So, I dunno.....perhaps changing "dim rs as dao.recordset" to " Dim rs As
Object" might (?) be helpful.
Can Service pack 2 of Windows XP be the problem. Earlier I didn't have this
problem.

Don't know. Most of my work with Access is still being done using the
Windows 2000 operating system.


Tom

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top