I am using the dbexpasa.dll (7.1) to connect a Delphi 7 application to an ASA 9 network database. Unfortunately, there are multiple databases with the same service (HOST) and database name on the network. Although Sybase documentation seems to indicate that you can specify a physical server name or IP address in the LINKS parameter of the connection string, I have been unsuccessful at getting that to work. I have played around with the asasrv.ini file to control which physical server the connection hits, but that file seems to automatically be modified if that server is not available, so I never know for sure where the connection is going to go. Here is a connection string that works, but without specifying the physical server: HOSTNAME=<databaseservicename>,DATABASE=<databasename>,USER_NAME=<username>,PASSWORD=** I have tried to add LINKS=TCPIP(IP=10.10.xx.xx:2638) or LINKS=TCPIP(HOST=10.10.xx.xx:26338) to no avail. Is it possible to include the physical server name or is the only solution to rename the database services to be different?

Thanks

asked 15 May '12, 08:50

dan1's gravatar image

dan1
31114
accept rate: 0%

edited 15 May '12, 12:21

Volker%20Barth's gravatar image

Volker Barth
29.9k294446654


As far as I can tell, HOSTNAME, DATABASE and USER_NAME are not the names of connection string parameters in SQL Anywhere 9... are they Delphi things, or just speling misteaks in your question?

The HOST keyword is an inner-level TCPIP protocol parameter, not an outer-level connection string parameter. HOST is the computer name or IP address... it is not the service name... I don't think the service name can be specified anywhere, but I may be wrong.

FWIW the asasrv.ini file is a cosmic-level annoyance, and has often been the cause of connections made to a server OTHER THAN the one specified in the connection string.

Here is an example of a connection string. In this case, the ddd.db database file has been started by dbsrv9.exe, causing both the runtime database name (DBN) and engine name (ENG) to default to "ddd". The HOST protocol option specifies the ip address for the computer running the database, plus the port :2638 being used , and the DOBROAD=NONE protocol option provides two benefits: It suppresses all the asasrv.ini foolishness, as well as all broadcasting to look for the database on other computers; in other words, if the HOST doesn't work the connection will fail, which is what you want (it's what EVERYBODY wants in my opinion):

"ENG=ddd;DBN=ddd;UID=dba;PWD=sql;LINKS=TCPIP(HOST=10.10.xx.xx:2638;DOBROAD=NONE)"

Generally speaking, in a network environment with any level of sophistication whatsoever, DOBROAD=NONE is your friend.

permanent link

answered 15 May '12, 09:14

Breck%20Carter's gravatar image

Breck Carter
27.3k424585836
accept rate: 21%

edited 15 May '12, 09:17

1

Thanks for the input. With dbExpress - dbexpasa.dll - in Delphi 7 you do not have direct control of the connection string. You have to build it from connection parameters in the TSQLConnection object (hence the commas instead of semicolons as well as the spelling). Using DBN and ENG as params doesn't do anything. You have to use params DATABASE and HOSTNAME (the service name). It looks like Delphi is only interpreting certain params into the connection string. (Incidentally, the ADO connection object does allow direct access to a connection string, but not the dbExpress objects.) I have been researching this for months without any clear indication that you can or cannot specify a physical server name in the params from Delphi. It looks like the solution for us will be to change the database server (service) names to be different from each other. It probably should have been done that way from the start anyway.

(15 May '12, 10:04) dan1
Replies hidden

The dbsvc utility that ships with SQL Anywhere 9 may help you to semi-automate the service naming process.

(15 May '12, 13:20) Breck Carter
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×97
×32
×9

question asked: 15 May '12, 08:50

question was seen: 1,877 times

last updated: 15 May '12, 13:20