SQL Anywhere Network connection

Source: Internet
Author: User
Tags odbc connection

When installing the ASA note Select the networked seat mode, change the value of licensed seats, its default value is 1, if not changed, the database at the same time only allow a user to connect.

Dbeng is only started as a single stand-alone data engine, and dbsrv to start a data Engine server, to send data in the network, so there are certain requirements for network configuration, such as must have a communication protocol, the same LAN can not have two of the same name of the data Engine server and so on.

Exclusive-access and shared-access
Exclusive mode, at this time the database is only allowed to connect the client to use, the other clients can not access;

The SQL Anywhere 9 example illustrates:
-----------------------------------------------------------
Step one, start the database
Start running
"C:\Program files\sybase\sql Anywhere 9\win32\dbsrv9.exe" "D:\Personal\Desktop\quicc_3.db"-N ccc-x tcpip{host= 192.168.0.7; serverport=14899}-Q
Start the database, here specify the port, detailed parameters please use Dbsrv9.exe/? get.

IP and HOST are synonyms.

-N servicename: Start a database service named ServiceName to mark the Network database service unique token;
-X tcpip{host=192.168.0.7; serverport=1489}: Use the TCP/IP protocol, and specify IPs and ports (note port occupancy, default port 3362);
-Q: Run in the background, no database running interface, only see the process;

Step two, establish an ODBC connection

After successful startup, another machine operation:odbc-> Create a new adaptive SQL Anywhere9.0 data source, configured as follows:

1.odbc->data sourse Name: Data Source Name
2.login-> Login User/password
3.database-> ServerName Enter the servicename specified in step one
4.Network, hook in TCP/IP, enter the IP address of the machine where the server is started, the format is as follows: host=192.168.0.7, other protocols can not be selected.

Repeat the 3rd step, you can configure multiple clients, of course, the server can also configure an ODBC to connect to their own.

At startup:

When connecting:

ls_parmstring= "connectstring= ' dsn=xxxxx;dbn=;D bf=; Enginename= "+ls_serverengname+"; UID=DBA; Pwd=yourpwd; Commlinks=sharedmemory,tcpip{host= "+ls_tcpip+"} ', connectoption= ' sql_driver_connect,sql_driver_noprompt ' "
Sqlca.dbms= "ODBC"
sqlca.dbparm=ls_parmstring
sqlca.autocommit=true
Connect;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.