ODBC to Sybase ASE Server returning only blanks and NA values


I am using a User DSN to connect to a Sybase ASE server to pull data for my analysis.

I have provided the correct credentials and server details (name, ports etc.) and can successfully test the connection to make sure all is well. By the way my DSN name is "Phbit".

I then tried connecting to the same server from RStudio using the following code:

Set environment ----------------------------------------------------

pacman::p_load(odbc, tidyverse, DBI)

# make a connection to the Phbit database
phbit_conn <- dbConnect(odbc(), "Phbit")

However when I run the connection above I receive the following error:

Error: nanodbc/nanodbc.cpp:983: ZZZZZ: [SAP][ASE ODBC Driver][Adaptive Server Enterprise]Login failed.

I then modified the connection to include the specific details:

phbit_conn <- dbConnect(
dsn = "Phbit",
UID = "myUsername",
PWD = "myPassword",
Port = 4108)

This worked as I received no error, great!

I then took the SQL code that I have run many times directly against the Sybase ASE database using DBVisualiser and pasted it into a dbGetQuery function.

phbit_data <- dbGetQuery(phbit_conn, "SELECT * FROM TABLE A")

This took a short time to run and it returned 63365 rows across 27 columns of data (exact same dimensions as what I get using DBVisualiser) but there was no information in the dataframe. Either all rows and columns are blank or NA values.

Is there something I am doing wrong with the code I am using?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.