Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    Join Date
    Oct 2007
    Posts
    10

    Unanswered: VB5, Access database, 3027 Read only error ...

    Hi,

    I developed an application in VB5 using a database created in Microsoft Access 97 under Win 98 (ahhhh, stop laughing, I can hear you).

    The application is installed and running on a WinXP system and it's fine.

    I installed VB5 onto my laptop and when I run the program, the very first database write (rs.addnew) causes a 3027 error ... database or object is readonly.

    -It's not the readonly attribute on the data control.
    -It's not the readonly file attribute on the MDB file (although the directory readonly attriibute is greyed, not cleared. I have cleared it and tried it. I have ticked it and tried it. Always returns to greyed though. Not sure why)
    -Updatable property on the database property is set to True

    Have read briefly on the net of the same problem however no resolution was forthcoming other than putting everything in QueryDefs and using Execute to perform them. Ummmm ... 134 addnew or edit ... that's not going to happen.

    Any ideas ?


    Cheers Dave

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Post the code that declares your rs object please
    George
    Home | Blog

  3. #3
    Join Date
    Oct 2007
    Posts
    10

    Hrmmm ..

    George,

    Thanks for your reply.

    I use the VB5 development environment and place a data control on the form.

    I then set the DatabaseName, recordset etc in the properties window.

    So I am not quite sure what you mean.

    I don't consider myself newb having VB'd for nearly 8yrs, but it has been with VB5 so I don't know any other method to create an rs object.

    Cheers Dave

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    No worrie, was just thinking that maybe your recordset properties were read-only or similar...

    How about posting the offending code up here so we can ponder?
    George
    Home | Blog

  5. #5
    Join Date
    Oct 2007
    Posts
    10

    ...

    ... well I could, but it won't help much. If it were a code or property thing, I think I would have stumbled across it.

    As I said there are over 100 calls like this and it runs fine on Win98 and the target XP system

    The code line that causes the error is the first 'write' attempt to the database. It quite literally says ...

    dLogin.Recordset.Edit
    dLogin.Recordset!lastlogin = format(now, "yyyy-mm-dd")
    dLogin.Recordset.Update

    It faults on the .Edit line.

    I wonder if I install MS Access 97 if that will rectify it - I doubt it.

  6. #6
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Is lastlogin a datetime field or other?
    George
    Home | Blog

  7. #7
    Join Date
    Oct 2007
    Posts
    10

    yep ...

    ... yep, it is a date/time field.

    It's the first write to the DB in the program so I hadn't wondered whether it was a date/time mismatch.

    Is that what you were getting at ?

    Cheers Dave

  8. #8
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Yep. It also seems unneccessary to format the date, but then again Access does like to mis-behave with it's datetime values!

    This may sound like a(nother) completely stupid question but is there actually a record in the recordset and can you prove this? I'm suggesting this because a.Edit will fail when there's nothing there to edit! Furthermore the switch of platform may cause an API such as retrieving NT username to stop working correctly, which I assume is being used with this login procedure.

    I'm not very good at debugging VB that I can't see
    George
    Home | Blog

  9. #9
    Join Date
    Oct 2007
    Posts
    10
    ... what is this NT api that you speak of ?



    The particular screen is two textboxs, username and password.

    The username is matched to the database and the password checked ... if we have a match we update the lastlogin field with the current date/time.

    No api calls that I have added.

    I appreciate the help so far, the annoying thing is that it works perfect on Win98 and the target system (which is WinXP) it's been installed for about 3 yrs

    Cheers Dave

  10. #10
    Join Date
    Oct 2007
    Posts
    10

    File enclosed ...

    George,

    Here is the entire form file ...

    http://www.rockshop.co.nz/dave/fLogin.frm

    ... hope you can see what it is that I have done from there.

    Cheers Dave

  11. #11
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    What OS software/version is installed on your laptop?

    What MDAC version is installed on your laptop?
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


  12. #12
    Join Date
    Oct 2007
    Posts
    10

    ...

    loquin,

    Thanks for your reply.

    It's WinXP Home SP2. What's MDAC ?

    George et al - I have some further news. Installing Microsoft Access didn't help. I did create a new project with a database and can AddNew and Edit with no problems.

    So it looks like it could be something directly related to this install of VB and the project files.

    I am going remove VB 6 from my other system and install VB 5 on it to see if I have the same issue.

    In the meantime, if anyone has any ideas - I am so open to them.

    Cheers Dave

  13. #13
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    MDAC = Microsoft Data Access Components. It includes the JET database drivers. Later versions of MDAC don't include Jet 3.5 - only Jet 4.

    If the connection string in your code references Jet 3.5, you'll get a connection error.

    Now, where is the mdb file located? And, how are you logged in on the laptop (as an administrator, power user, or user?)
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


  14. #14
    Join Date
    Oct 2007
    Posts
    10
    loquin,

    okay, thanks for that.

    i get no connection errors that I can see ( no error message comes back and says 'error in connection'). wouldn't the install process of VB install JET 3.5 drivers ?

    if I can create a new project and add / edit / delete from the a new mdb ... does that mean that your 3.5 vs 4 isn't the issue or will the new project/mdb be using JET 4 instead of JET 3.5, so it works ?

    I am logged in as administrator.
    Last edited by Lil_Dave; 10-17-07 at 18:35.

  15. #15
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    What does the connection string look like in your VB app?
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •