[R] connect MSSQL server problem

Kai Yang y@ngk@|9999 @end|ng |rom y@hoo@com
Fri Mar 17 20:08:47 CET 2023

Hi Team,I need to connect two MSSQL servers. One server ask me to enter user name and password. I can use dbConnect (from DBI package) to connect the serve.Another one do not ask me credential to access the serve. But when I remove UID and PWD, it doesn't work. Then I tried to use my PC log in credential for UID and PWD, it still doesn't allow me to access. The error message: Error: nanodbc/nanodbc.cpp:1021: 28000: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Login failed for user '******'. How to modify the code (see below) to access second MSSQL server?
con <- dbConnect(odbc(),                 Driver   = "ODBC Driver 17 for SQL Server",                 Server   = "abcdefghijklmn",                 Database = "abc_def")
Thank you,Kai
	[[alternative HTML version deleted]]

More information about the R-help mailing list