Closed erex closed 8 years ago
Paths with spaces in should work, they just must be escaped properly. It's possible this behaviour is to do with mdb.get
rather than RODBC
.
In any case, my long/path with/spaces
should become my\\ long/path\\ with/spaces
and work fine.
Frustrating:
[1] "C:/Users/eric/readdst-workshop/D70Cluster\\ solutions"
Error in db_get(project_file, "ProjectSettings") :
RODBC is unable to open C:/Users/eric/readdst-workshop/D70Cluster\ solutions.dst
table= ProjectSettings
In addition: Warning messages:
1: In odbcDriverConnect(dsn) :
[RODBC] ERROR: state HY024, code -1023, message [Microsoft][ODBC Microsoft Access Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
2: In odbcDriverConnect(dsn) :
[RODBC] ERROR: state 01000, code 1, message [Microsoft][ODBC Microsoft Access Driver]General Warning Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x1f94 Thread 0x1a0c DBC 0x13d3c354 Jet'.
3: In odbcDriverConnect(dsn) : ODBC connection failed
Called from: db_get(project_file, "ProjectSettings")
The above error is thrown in db_get() because of a malformed path. However if lines 22-24 were replaced with more specific code to get into Access2007 databases
db <- odbcConnectAccess2007(file)
then the line would parse as
db <- odbcConnectAccess2007("C:/Users/eric/readdst-workshop/D70Cluster solutions.dst")
which throws no errors.
I had been trying to avoid using the version specific code in the packge as this would require an import of that function, which does not exist on non-Windows platforms.
I'll look at a work-around for this.
Will:
odbcDriverConnect("Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=C:/Users/eric/readdst-workshop/D70Cluster solutions.dst")
work for you?
the answer is 'yes' that string works on Win7; however JaNet still has DoS attacks, so I can't get to github to tell you this.
On 07/12/2015 22:17, DL Miller wrote:
Will:
|odbcDriverConnect("Driver={Microsoft Access Driver (.mdb, .accdb)};DBQ=C:/Users/eric/readdst-workshop/D70Cluster solutions.dst") |
work for you?
— Reply to this email directly or view it on GitHub https://github.com/DistanceDevelopment/readdst/issues/19#issuecomment-162684814.
Eric Rexstad 20 West Braes Crescent Crail Fife KY10 3SY
Thanks for checking this Eric. Code in readdst has been changed as of fcf5bce. Let me know if that fixes things for you.
On 08/12/2015 04:41, erex wrote:
the answer is 'yes' that string works on Win7; however JaNet still has DoS attacks, so I can't get to github to tell you this.
On 07/12/2015 22:17, DL Miller wrote:
Will:
|odbcDriverConnect("Driver={Microsoft Access Driver (.mdb, .accdb)};DBQ=C:/Users/eric/readdst-workshop/D70Cluster solutions.dst") |
work for you?
— Reply to this email directly or view it on GitHub
https://github.com/DistanceDevelopment/readdst/issues/19#issuecomment-162684814.
Eric Rexstad 20 West Braes Crescent Crail Fife KY10 3SY
— Reply to this email directly or view it on GitHub https://github.com/DistanceDevelopment/readdst/issues/19#issuecomment-162831847.
anything to create a diversion from marking. My sense today is that I taught them nothing in the past 12 weeks of my (and their) life.
Project marks awarded today (all on a 40-mark scale): 8, 11, 10, 22, 16, 17
Doesn't exactly work, because you still have the gate locked on line 20 of convert_project.R [1] "C:/Users/eric/readdst-workshop/D70Cluster solutions" Error in convert_project(fname) : Project path contains spaces, please escape them properly using "\"
Ah, whoops. Try 5a6ec99.
On 08/12/2015 11:45, erex wrote:
Doesn't exactly work, because you still have the gate locked on line 20 of convert_project.R [1] "C:/Users/eric/readdst-workshop/D70Cluster solutions" Error in convert_project(fname) : Project path contains spaces, please escape them properly using "\"
— Reply to this email directly or view it on GitHub https://github.com/DistanceDevelopment/readdst/issues/19#issuecomment-162941375.
Mixed reaction...
I think db_get
may be contented, but the Cluster solutions
project throws up new challenges apparently when trying to make a dataframe out of something:
[1] "C:/Users/eric/readdst-workshop/D70Cluster solutions"
Loading required package: RODBC
Error in data.frame(Region.Label = names(Effort.by.region), CoveredArea = CoveredArea, :
arguments imply differing number of rows: 2, 0
Called from: data.frame(Region.Label = names(Effort.by.region), CoveredArea = CoveredArea,
Effort = as.vector(Effort.by.region))
Okay, the first issue with spaces is now fixed, I think (63c8747). Let's move this new problem to a new issue in #20.
I know you spent a chunk of Friday fighting with spaces in path names. But it inhibits the utility of
readdst
that it can only work with directories and files without spaces. By default DisWin projects are stored in a folder called "My Distance Projects" and of the sample files that ship with DisWin, 4 of those file names contain spaces.Maybe I don't understand the 'proper delimiting' business. My experiment suggests it is not RODBC functions that struggle with spaces
Do problems arise further downstream after
sqlFetch()
? If not, can the blockade of 'paths with spaces' be lifted?