0

I am trying to establihs connection with database server using

library(RODBC)
myconn <- odbvConnect(dsn="SERVER\NAME", uid="user", pwd="password")

Server name has "\". I've also tryed using

"SERVER\\NAME"

as suggested on this topic. But that doesn't work either because than boath slashes are written in and I get error that server couldn't be found.

So question: how do I need to type \ so R will understand it as single character?

Community
  • 1
  • 1
ogiz
  • 33
  • 1
  • 7
  • "both slashes are written" only when `print()`ing inside of R because it doesn't escape values. If you `cat()` that value in R you should see a single slash. So the string "SERVER\\NAME" in R has just one slash. What is the problem you are having with your connection? – MrFlick Jun 11 '14 at 12:57

2 Answers2

0
myconn <- odbvConnect(dsn=@"SERVER\NAME", uid="user", pwd="password")
Sefa
  • 8,865
  • 10
  • 51
  • 82
0
cn<-odbcDriverConnect(connection="Driver={SQL Server Native Client 11.0};
server=LPT-11\\SQLEXPRESS;database=dbname;Uid=username;
Pwd=pass;trusted_connection=yes;")