cancel
Showing results for 
Search instead for 
Did you mean: 

Connect to Sybase SQL Anywhere from a remote location.

Former Member
0 Kudos

BH
Hi, we are running SQL Anywhere 16.  Currently our client computers are connecting through ODBC.  Is there a way to connect to our server from a Remote Location (over the internet)?  If yes, how?

Thanks

Aron

Accepted Solutions (1)

Accepted Solutions (1)

jeff_albion
Advisor
Advisor
0 Kudos

Hi Aron,


Is there a way to connect to our server from a Remote Location (over the internet)?

Yes, there is.


If yes, how?

You will need to supply a HOSTNAME (or direct IP) and PORT to the server running the network database server, communicating over TCP (Note: This may involve opening a TCP port on your firewall to provide a direct TCP route). For the SQL Anywhere client, this information can be set in the ODBC DSN entry as the following screenshot shows:

Note that this is unencrypted traffic across TCP/IP, by default.

If this communication is over the Internet, using an unencrypted channel directly to the database is not recommended. Instead, we would recommend that you also configure Transport Layer Security (TLS) with strong encryption enabled using a certificate (either self-signed or provided by a Certificate Authority (CA)). To do this, you need to create the certificates and then start the SQL Anywhere database server with the (private) server-side identity certificate.

Once the database server is started, you will then need to configure the client for secure communication with the public certificate. When configuring Transport Layer Security on the ODBC client, the security settings (e.g. trusted_certificates, certificate_unit, certificate_company, certificate_name) can be entered on the "Network" tab:

Regards,

Jeff Albion

SAP Active Global Support

Former Member
0 Kudos

BH
Hi Jeff, thanks for your reply.  I'm going to give that a try.  Does it matter which port is open? Do i have to do something on the Sybase SQL Server (Maybe set some parameters in Sybase Central)?
Thanks

Aron

jeff_albion
Advisor
Advisor
0 Kudos

Hi Aron,

     >> Does it matter which port is open?

Not specifically, provided that it is a TCP port (not UDP). The default port the database server starts on is 2638 - this can be controlled using the dbsrv16 -x switch. e.g.


   dbsrv16 -x tcpip(port=2639) ...

If you have a firewall, you can also add a static port mapping from an external port number to an internal port number.

Regards,

Jeff Albion

SAP Active Global Support

Answers (1)

Answers (1)

s_peccenini
Explorer
0 Kudos

Hi all,

could you explain how I can found my  "SERVER NAME" and "DATABASE NAME" values?

thanks

former_member188493
Contributor
0 Kudos

Both those names are determined dynamically when the server and database are started. There are several ways you can determine them:

First, if you can connect to the database, you can ask it (but that might be a Catch 22 situation):

SELECT PROPERTY ( 'Name' ) AS ServerName,

       DB_PROPERTY ( 'Name' ) AS DatabaseName;

ServerName,DatabaseName

'inventory16_xps','inventory16'

Second, if you can see the command line that started the database, you may see this:

...dbsrv16 ... -n ServerName ... c:\path\dbfile.db ... -n DatabaseName

If the first -n exists then that is the ServerName.

If the first -n does not exist then the ServerName is the same as the DatabaseName (to be determined).

If the second -n exists then that is the DatabaseName.

If the second -n does not exist then the DatabaseName is the same as the file name "dbfile".

In many cases neither -n is specified so dbfile is both the ServerName and EngineName.

Third, if you can see the diagnostic console log window or dbsrv16 -o file.txt then it displays both names.