Skip to content
Prev 75904 / 398502 Next

using paste and "\" to create a valid filename

I was surprise myself that I was having problems, because I have been
doing this for ahile, but I get erros with the RODBC connection.  For
example,

rankFile <- paste("R:\\New Ranks\\SMC\\SMC\\",rankDate,".xls", sep="")				
			rankFile
			xls <- odbcConnectExcel(rankFile)
			xls
			rankFile <- "R:\New Ranks\SMC\SMC\20050818.xls"			
			rankFile
			xls <- odbcConnectExcel(rankFile)
			xls


You won't have my filename, but feel free to try it with any excel
file you may have. Here is the R output.
[1] "R:\\New Ranks\\SMC\\SMC\\20050819.xls"
Warning messages:
1: [RODBC] ERROR: Could not SQLDriverConnect 
2: ODBC connection failed in: odbcDriverConnect(con)
[1] -1
[1] "R:New RanksSMCSMC?50818.xls"
RODB Connection 15
Details:
  case=nochange
  DBQ=R:New RanksSMCSMC?50818.xls
  DefaultDir=R:\NEW RANKS\SMC
  Driver={Microsoft Excel Driver (*.xls)}
  DriverId=790
  MaxBufferSize=2048
  PageTimeout=5

        
On 8/19/05, Uwe Ligges <ligges at statistik.uni-dortmund.de> wrote: