I'm sorry the following was a typo on my part:
cnxnStr = cnxnStr = "Data Source=C:\filepath.accdb"
my code actually reads:
cnxnStr = "Data Source=C:\filepath.accdb"
I've been to connectionstrings.com, that;s where I got the following string:
cnxnStr = "Provider=Microsoft.ACE.OLEDB.12.0;Data
Source=filepath.accdb;Persist Security Info=False;"
When I use this string it gives me the following error:
Runtime error '-2147467259 (80004005)':
The Database has been placed in a state by user "Admin" on machine
'SUMMER-PC' that prevents it from being opened or locked.
I don't know why it does this, I'm asumming it has something to do with the
connection string because the program runs fine when I comment the string
out. I've looked extensively on Connectionstrings.com for another string but
I can't find any other than the one that gives this error.
Thanks for the help - sorry for the typo
--
Piper
"Stefan Hoffmann" wrote:
> jelybeans schrieb:
> > Can someone help me troubleshoot my connection string? I'm using Access 2007.
> > Here is my current code:
> > cnxnStr = cnxnStr = "Data Source=filepath.accdb;"
> This is the problem:
>
> This line evaluates the comparison and returns a boolean converted to
> string.
> It's the same as
>
> cnxnStr = (cnxnStr = "Data Source=filepath.accdb;")
> MsgBox cnxnStr
>
> btw, for connection strings see:
>
> http://connectionstrings.com/access-2007
>
>
> mfG
> --> stefan <--
>