There are several issues with your code, the connection string does not seem to be one of them.
1. You are opening a connection to your database and attempting execute some SQL - but you have not defined where the results should go
2. You are creating an empty Recordset and not populating it
3. The table name has an invalid character in the name, the hyphen. So you must surround that name with square brackets in order to get the SQL to work (it would have helped if you had shared details of the error(s) that were reported)
Try this instead
Dim conn As Object, rs As Object
Set conn = CreateObject("ADODB.Connection")
conn.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data source=c:\dev\0-Access\VSOP87-J2000.accdb;"
Set rs = CreateObject("ADODB.Recordset")
rs.Open "SELECT * FROM [VSOP87-0];", conn
4. Your next problem is at the other end of your code - you are attempting to close the Recordset after closing the connection. The latter will effectively close the recordset as well (once you have done the steps above to associate the recordset with the connection). it should be
rs.Close
conn.Close
A general rule of thumb is to close things in the reverse order that you opened them e.g.
A.Open
B.Open
C.Open
.
.
.
C.Close
B.Close
A.Close
As to the rest of it
Quote:
This gives an error.
Give us a clue what the error is, or what version of VB you are using, and we might be able to help with that - although see the link in Solution 1
Quote:
Not sure how the .value on the rs("A0mer") works for all.
Not clear what you mean by this. In your code it is not "working" because that line of code is never executed because rs.EOF is always true in your version