Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Can anyone advise on the best approach for specifying a Sybase connection string.
When using Oracle OLEDB drivers I use a connectoin string like
SET ConnectString='[Provider=OraOLEDB.Oracle;Data Source=(TNS_NAMES_ENTRY)] (XUserId is X, XPassword is Y)';
OLEDB CONNECT TO $(ConnectString);
Where TNS_NAMES_ENTRY is the filkl specification for Oracle as it might appear in a tnsnames.ora file.
This does not require any other settings on the server, no tnsnames.ora file no entries in the Windows ODBC administrator.
I want to do something similar for Sybase Adaptive Server 15.7 using ODBC. Again I would prefer to not have a sybase sql.ini file that needs maintaining and do not want to set up a DSN in Windows ODBC Administrator.
I found a variety of options at this site
Sybase ASE OLE DB Provider Connection Strings - ConnectionStrings.com
This is the option that worked for me:
Provider=Sybase.ASEOLEDBProvider;Srvr=myASEserver,5000;Catalog=myDataBase;User Id=myUsername;Password=myPassword;
But it did involve choosing OLEDB rather than ODBC.
We use the Sybase OLEDB provider to connect
OLEDB CONNECT32 TO [Provider=Sybase.ASEOLEDBProvider.2;Initial Catalog=tempdb;User ID=<userid>;Data Source=<servername>;Extended Properties=""] (XPassword is VXYIDbJOJTaIWQdMRJOYN);
With ODBC you are required to set up a datasource. With Sybase OLEDB you still need a .ids config file with the serverdetails (made with the Sybase ASE OLEDB Configuration Manager).
I found a variety of options at this site
Sybase ASE OLE DB Provider Connection Strings - ConnectionStrings.com
This is the option that worked for me:
Provider=Sybase.ASEOLEDBProvider;Srvr=myASEserver,5000;Catalog=myDataBase;User Id=myUsername;Password=myPassword;
But it did involve choosing OLEDB rather than ODBC.