Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2007
    Posts
    1

    Exclamation Unanswered: Run-time error '3112'

    Hi.when i open my access bank , and i try to run the forms and report in this bank the error apear that :
    Record(s) can't be read; no read permission on'.....'.
    when i run Debug buttom these will be appear:
    Private Sub SearchWord_KeyPress(KeyAscii As Integer)
    Dim pn As Integer
    On Error GoTo 1000
    If KeyAscii = 13 Then
    pn = Me![ProposeNo]
    DoCmd.OpenForm "ProposeMainForm"
    DoCmd.FindRecord pn
    ElseIf KeyAscii = 27 Then
    DoCmd.Close acForm, "ProposeEnter"
    End If
    GoTo 2000
    1000:
    DoCmd.OpenForm "ProposeMainForm"
    2000:
    End Sub
    then when i use debug/compile progress form this will appear:
    compile error:user-defined type not defined
    and when i prees ok you can see:
    Private Sub Command23_Click()
    DoCmd.OpenReport "vosool", acViewPreview
    Dim DB As Database
    Dim TABLE As Recordset
    thank you for your help.because this access bank is the main part of my work and I dont have back up.

  2. #2
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    No backup? - ouch. From the error you described (Record(s) can't be read; no read permission on'.....), my initial thought is that there is a security mdw file on the mdb and the username/password you're using doesn't have read permissions on the table (unless you're able to open the tables directly without problems - can you do this?) If you do have security on the mdb, see this post: http://www.dbforums.com/showthread.php?t=1625527.

    If there is a security mdw file, you need to open it with a username and password that allows you read permissions. The problem could also be related to this error: "compile error:user-defined type not defined" - I'd check that a reference isn't missing. Check the references when viewing the code (Tools->References) to make sure none of them have "missing".

    Also, the problem could very highly be related to this: Dim TABLE As Recordset, as it doesn't look right to me. TABLE is a keyword that you don't want to Dim as a recordset and can most likely be giving you problems. Try replacing all the "TABLE" wording with something like "RS". If you can, perhaps zip the mdb and attach it and we can help you diagnose the problem (unless you have a security mdw file on it.)

    You can also try opening the mdb using the /decompile option, or try compacting/repairing, or try importing the tables, forms, reports, modules, etc into a new mdb file.

    Make a backup (copy/paste) of your mdb. I do this everytime before I get into the mdb and start coding. If the mdb is large in size due to the table sizes, you may want to consider splitting the mdb so you can easily copy/paste the frontend before you start coding.
    Last edited by pkstormy; 12-15-07 at 03:02.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  3. #3
    Join Date
    Sep 2007
    Location
    Global Village
    Posts
    185
    Indeed as pkstormy mentioned first of all take a back up from your Db, you quoted your problem very generally, if you still have the problem after checkings pkstormy advised then put some break points in your code and check up to which point your cde works and find the exact line of problem, you can use "step in to" also if your code is in one of your modules.
    finally give some more detail of error.
    Movafagh Bashid.

Posting Permissions

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