I have a problem connecting to a MSSQL DB from Rstudio
The following code
SRC.connection <-
DBI::dbConnect(odbc::odbc(),
Driver = "SQL Server",
Server = 'IP',
Database = "DBname",
UID = 'uid',
PWD = rstudioapi::askForPassword("Database password"),
Port = port)
throws the following error message:
Fehler: nanodbc/nanodbc.cpp:983: 01S00: [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server existiert nicht oder Zugriff verweigert. [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Connect()). [Microsoft][ODBC SQL Server Driver]Ungültiges Attribut für die Verbindungszeichenfolge
Using the same credentials in DBeaver works perfectlly fine.
Also
DWH.connection <-
DBI::dbConnect(odbc::odbc(),
Driver = "PostgreSQL ANSI",
Server = 'IP',
Database = "dbname",
UID = 'uid',
PWD = rstudioapi::askForPassword("Database password"),
Port = 5432,
bigint = "numeric",
encoding = "latin1")
works perfectlly fine to connect to a postgres server in the same network.
Does anyone have any idea why this does not work as expected?