Accès à "Invalid SQL Statement"

Solved
Hello everyone !!!!!!

I have a big problem with Access XP.

Here is my code:
Dim maconnexion As New Connection Dim rs1 As New Recordset Set maconnexion = CurrentProject.Connection rs1.LockType = adLockOptimistic rs1.CursorType = adOpenKeyset rs1.ActiveConnection = maconnexion rs1.Source = "Contacts A" rs1.Open


It gets stuck on the rs1.open and tells me that the "SQL statement is not valid," even though it's not a SQL query at all, but VBA code.
I think it's a problem with an option that needs to be checked in the preferences, because from what I remember, this piece of code works fine on Access 2000.

Thanks to anyone who will help me !!!
Configuration: Windows XP Firefox 2.0.0.14

3 answers

  1. Contributor
    What is "Contacts A"? If it's the name of a table or a query, I suggest trying "[Contacts A]".
    1
    1. Hi,

      It actually worked.
      I suppose it's because of the space in my table name that there was this issue, as it works fine without a space.

      Thank you very much.
      0
      1. Contributor
        Indeed, it's because of the space.
        0