(Solved) – Excel to MS Access connection: Issues with with space in connection string

(solved)-–-excel-to-ms-access-connection:-issues-with-with-space-in-connection-string

I have been able to successfully connect my excel to MS access, and using the connection, I am able to push and pull data to and from excel to Access DB. However, I noticed, if my connection string has space in between like mentioned below, I am unable to establish the connection. Is there any way around it?

Connection string with space

Set oADODBCon = New ADODB.Connection
    oADODBCon.Open Microsoft.ACE.OLEDB.12.0;Data Source=\XYZ-123123ABC 2020 Test OperationsMyDb.accdb;Persist Security Info=False;

I have tried using single quotes in my connection string as below but it still didn’t work

Set oADODBCon = New ADODB.Connection
    oADODBCon.Open Microsoft.ACE.OLEDB.12.0;Data Source='\XYZ-123123ABC 2020 Test OperationsMyDb.accdb';Persist Security Info=False;

Any help would be much appreciated!

Leave a Reply

Your email address will not be published. Required fields are marked *