0

I am trying to open an access DB in the form of read only using Excel VBA.

This is the code that I have at the moment,

        Set cn = CreateObject("ADODB.Connection")
        cn.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & DBFullName & ";"

        Set rs = CreateObject("ADODB.Recordset")
        rs.Open "SELECT DISTINCT A_Name FROM app_tbl ORDER BY A_Name ASC", cn, , , adCmdText

How can I open it as read only ?

1 Answer 1

3

Try

 cn.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & DBFullName & ";Mode=Read" 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.