Connect the Sybase ASE database using isql
The Sybase ASE Client tool has a more useful command-line tool, isql. With isql, you can perform almost any administrative maintenance work on the ASE database server.
Use the isql tool to connect to the RUSKYPC database server below. The client uses character set cp936 to log on. Use the login user name SA.
c:\users\administrator>isql-usa-sruskypc-jcp936
Password:
1>
If the returned result is: 1>, then the successful connection to the Sybase ASE Database server: Ruskypc.
Otherwise, if you return:
c:\users\administrator>isql-usa-sruskypc-jcp936
Password:
MSG 4002, Level 1:
Server ' Ruskypc ':
Login failed.
Ct-library Error:
Ct_connect (): Protocol specific layer: external error:the attempt to connect to the server failed.
Indicates a bad login password.
If you return:
C:\users\administrator>isql-usa-sruskypc1
Password:
Ct-library Error:
Ct_connect (): Directory service layer: internal Directory control layer error:requested server name not found.
C:\users\administrator>
Indicates that the server name specified in the isql command line parameter does not exist, specify the server name that exists in the Dsedit.
If you return:
C:\users\administrator>isql-usa-sruskypc
Password:
Ct-library Error:
Ct_connect (): Network packet layer: Internal Net Library Error:net-lib protocol driver call to connect both endpoints Failed
This means that the network does not work or the destination Sybase ASE database server is not started or the ASE server is not listening on the port.
At this point, you need to use the Dsedit tool to confirm that you can ping the Sybase ASE server.
When executing the isql command to connect to the database, it is quick to report a password error and the service name does not exist for both errors. In other words: After isql the command line, you will soon be prompted for a service name that does not exist or a password error.
However, in the case of errors caused by the service not being started, it will take a while for the results to occur. Because isql needs to wait for the ASE server to respond. In fact: When connecting to the Sybase ASE database, isql will attempt to sql.ini all the listening information under the corresponding service name in the file. If all the listening information fails to connect, the message cannot be connected.
Common errors and how to connect Sybase ASE database using isql