I'm trying to connect to an SQL Anywhere database on the network.

Any help is appreciated.

Thanks

Here is the connections string:

MICROS&Provider=SAOLEDB.11;UID=custom;PWD=custom;ENG=sqlmicros1;CON=SQL_DBC_190f07d8;LINKS='TCPIP(IP=10.4.0.40;PORT=2638)'

Here is the error I'm getting.

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Data.OleDb.OleDbException (0x80040E4D): Connection error: Found server but communication error occurred
at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection)
at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)

asked 02 Oct '11, 11:50

tspree15's gravatar image

tspree15
1111
accept rate: 0%

edited 03 Oct '11, 07:27

Volker%20Barth's gravatar image

Volker Barth
31.5k318461676

(02 Oct '11, 15:52) Breck Carter

You should be able to feed the connection string to the SAConnection class (which is a spezialized type of the generic .Net DBConnection class), either as a common connetion string, or with the help of the SAConnectionStringBuilder class.

I haven't used this myself, but the handling seems quite easy...look at that doc page.

permanent link

answered 03 Oct '11, 07:26

Volker%20Barth's gravatar image

Volker Barth
31.5k318461676
accept rate: 33%

Generically, "Connection error: Found server but communication error occurred" means just what the message implies - the connection library was able to find the targeted server name via UDP broadcasting (e.g. "sqlmicros1"), but couldn't make an active TCP connection to it (over "10.4.0.40:2638").

Are you sure that the "sqlmicros1" database server is running on that IP/port? Can you check dblocate 10.4.0.40 to see if it can see this server as well? Can you add the connection option "LOG=c:\connlog.txt" to the connection string, and review the resulting log to check how the client is attempting to contact this server?

permanent link

answered 04 Oct '11, 13:52

Jeff%20Albion's gravatar image

Jeff Albion
10.7k171174
accept rate: 24%

edited 04 Oct '11, 13:52

Try using DbConnection, it's better than OLEDB.

I'm presuming that you are using .net .

EDIT:

sample connectionString="uid=DBA;pwd=sql;ServerName=DemoDB;links=tcpip(host=my.server.name;port=5577)"

permanent link

answered 02 Oct '11, 21:55

Zote's gravatar image

Zote
1.7k364050
accept rate: 43%

edited 03 Oct '11, 15:37

1

Yes, I am using .net. Any chance you can provide the connection string using DbConnection?

Thanks,

Todd

(02 Oct '11, 22:19) tspree15
Replies hidden

see my response again :p

(03 Oct '11, 15:37) Zote

Why are you specifying a connection name ("CON=SQL_DBC_190f07d8"), especially one which looks very similar to the names generated automatically?

If a connection with that name already exists, you are creating your own conflict in naming.

Try omitting the CON= parameter and see if your problem goes away with it.

permanent link

answered 04 Oct '11, 10:48

William%20Clardy's gravatar image

William Clardy
6115
accept rate: 0%

edited 04 Oct '11, 10:48

2

AFAIK there's no rule against duplicate connection names, and SQL Anywhere certainly doesn't check for uniqueness. Maybe some application or other might get confused if it's expecting uniqueness but that would not explain the symptom here... IMO anyway. FWIW I just successfully created 10 dbisql sessions all with CON=SQL_DBC_190f07d8... the title bars all say exactly the same thing "SQL_DBC_190f07d8 - Interactive SQL"

(04 Oct '11, 11:55) Breck Carter

Dang, putting my ignorance out there is getting educational!

I never realized that the connection names aren't unique. That is interesting -- not terribly useful, but definitely interesting in a "I wouldn't do it that way" sense.

Thank you for the correction, Breck.

(04 Oct '11, 13:17) William Clardy

May this be related to .NET Connection pooling?

Once you have tried to use the native SQL Anywhere data provider (see my other answer), you might try whether the enabling/disabling of connection pooling will have an influence.

permanent link

answered 04 Oct '11, 12:23

Volker%20Barth's gravatar image

Volker Barth
31.5k318461676
accept rate: 33%

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:

×137
×132
×56

question asked: 02 Oct '11, 11:50

question was seen: 4,030 times

last updated: 04 Oct '11, 13:52