Link to home
Start Free TrialLog in
Avatar of fmichail
fmichailFlag for Canada

asked on

How to handle connection string for an ACCESS database if its path contains semicolon

I have a connection string for MS access database defined as follows:

        oAccessConnection.ConnectionString = String.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};", sMdbPath)

When trying to open it I get a problem caused by a semicolun in the sMDBPath. I need to keep these folders without renaming, How to prevent the connection from considering the semicolun as a connectionstring attributes separator, and deal with it as a normal character. Thanks
SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of fmichail

ASKER

Thanks this fixed the problem... I appreciate your help. I am going to split the points as both ddayx10 and kaufmed have the same solution.
Well there was a difference in the code but I never mind sharing points with kaufmed.