hello guys!
anybody can help me this type of error in Login form. Im using combo box for multiple users
thank you very much.

Run-time error'-2147217865(80040e37)':

The Microsoft Jet database engine cannot fined the input table or query
'login'. Make sure it exists and that its name is spelled correctly.

(error in line 4)

Private Sub Form_Activate()
            Set rs = New Recordset
                SQL = "SELECT * FROM login "
                rs.Open SQL, con, adOpenStatic, adLockOptimistic, adCmdUnknown
                
            
                If rs.RecordCount <> 0 Then
            
               While Not rs.EOF
                    cmbUN.AddItem rs.Fields("UserName")
                   rs.MoveNext
               Wend
               End If
End Sub

Dani AI

Generated

As and pointed out, that Jet error means the database engine cannot locate an object named "login" in the file your code is actually connected to. The most common root causes are: the connection is opening a different .mdb/.accdb than you expect, the object is a saved query or linked table (not a native table), the name has a typo/trailing space or uses a reserved word, or the provider/connection string is wrong for the file type.

Practical checklist to resolve it:

  1. Confirm the exact file your app opens at runtime (absolute path). Relative paths can point somewhere else when the app runs.
  2. Open that file in Access and verify an object named exactly as used in code (check for trailing spaces, different prefix like tblLogin, or that it’s a query vs table).
  3. If the back-end is linked to SQL Server or another file, verify the link is valid.
  4. If the database is an ACCDB, use the ACE provider; Jet cannot open ACCDBs.
  5. Make sure you have the ADODB reference and that rs and con are ADODB types (mismatched libraries can cause odd errors). @abelingaw’s reminder to declare variables is important here.

Quick runtime checks (VB/ADO):

' Quick connection check
If con Is Nothing Then
    MsgBox "Connection object is Nothing"
Else
    MsgBox "State=" & con.State & vbCrLf & "ConnString=" & con.ConnectionString
End If
' Enumerate tables visible to the provider
Dim t As ADODB.Recordset
Set t = con.OpenSchema(adSchemaTables)
Do While Not t.EOF
    Debug.Print t.Fields("TABLE_NAME").Value
    t.MoveNext
Loop
t.Close
Set t = Nothing

If the connection string points at the intended file and the table list does not include the expected name, fix the path/link or rename/recreate the table. If the table is present but code still fails, check provider compatibility and ADODB references. These steps resolve this Jet error in the vast majority of cases; they extend the suggestions from and and target the less obvious causes (wrong file, linked objects, provider mismatch).

Recommended Answers

All 3 Replies

Make sure that your table (login) is exists in your database and table name spell correctly.

Try to do what JX said.

Maybe your table login doesn't exist or misspelled.

Or try this:

SQL = "SELECT * FROM [login]"

Oh one more thing, do you have this statement?

Dim SQL as String

Cheerz!!

Thank you all guys

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.