I came across an anomaly yesterday as a result of mistyping and although I know the resolution of the error I don't know what is going on and I'd like to understand what is happening.
In this code sniplet:
Dim dbpath As String
dbpath = "C:vbrandr\random\db1.mdb"
Set cnnstring = New ADODB.Connection
cnnstring.Provider = "Microsoft.Jet.OLEDB.4.0"
cnnstring.Open dbpath, "admin", ""
I'd missed out the first '\' in "C:\vbrandr\random\db1.mdb".
When I run the code (in IDE) an error was generated that read:
'C:\vbrandr\Random\vbrandr\random\db1.mdb' is not a valid path
What perplexes me is why "C:vbrandr\random\db1.mdb" turns into 'C:\vbrandr\Random\vbrandr\random\db1.mdb' ?
When I correct the typo the code works correctly.
(the folder name is C:\vbrandr\Random)
In this code sniplet:
Dim dbpath As String
dbpath = "C:vbrandr\random\db1.mdb"
Set cnnstring = New ADODB.Connection
cnnstring.Provider = "Microsoft.Jet.OLEDB.4.0"
cnnstring.Open dbpath, "admin", ""
I'd missed out the first '\' in "C:\vbrandr\random\db1.mdb".
When I run the code (in IDE) an error was generated that read:
'C:\vbrandr\Random\vbrandr\random\db1.mdb' is not a valid path
What perplexes me is why "C:vbrandr\random\db1.mdb" turns into 'C:\vbrandr\Random\vbrandr\random\db1.mdb' ?
When I correct the typo the code works correctly.
(the folder name is C:\vbrandr\Random)