Skip to Content
0

.NET Connection String for SQLAnywhere 17

Jan 11 at 02:27 AM

102

avatar image
Former Member

I'm using SAP's SQLAnywhere 17 .NET library to connect to a database (in PowerShell), but can't find anything on the internet for the connection string format.

My credentials are as follows:

  • Host: 10.10.10.10:12345
  • Server: testserver
  • UID: DBA
  • Password: 123
  • Database: testdb

This string does not work; gives me "The user 'SQL Anywhere' does not exist."

Host=10.10.10.10:12345;Server=testserver;DatabaseName=testdb;UserID=DBA;Password=123

This string generated by SQL Central does not work; gives me "The user 'SQL Anywhere' does not exist."

UID=DBA;PWD=123;Server=testserver;dbn=testdb;ASTART=No;host=10.10.10.10:12345
10 |10000 characters needed characters left characters exceeded

The error does not make sense. You have specified Uid (UserID) as DBA but the error message is that the User "SQL Anywhere: does not exist. The error message does not appear to be from SQL Anywhere. Can you please post the stack trace of the exception.

Here is an example connection string:

SAConnection conn = new SAConnection( "Host=sqla-host:2638;Server=sqla-server;UserID=JSmith;Password=secret");

which aligns to your connection string.

I wonder whether the the database have a custom login_procedure or connection event?

Are you able to try connecting to the demo database? There is a batch in the SQL Anywhere install newdemo.bat that can be used to create a new database based on the demo database.

Correction: This error is reported by SQL Anywhere. I am not sure why I missed the error when looking at the possible error text cases in docs. I still cannot explain the cause but will investigate.

0
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Koichi Ogawa
Jan 11 at 08:02 AM
0

I think the format of the host parameter is incorrect.
It should be specified as follows.
"UID=DBA;PWD=123;Server=testserver;dbn=testdb;ASTART=No;links=tcpip(host=10.10.10.10:12345)"

For details, Please refer to the following document.
"Host (IP) protocol option (client side only)"

Show 1 Share
10 |10000 characters needed characters left characters exceeded

No, starting with v12, there's both the HOST connection parameter (as used in the question) and the HOST protocol option you refer to.

So I guess the error must be in the way the correct connection string is used within the .NET/Powershell command...

0
Atsushi Asano
Jan 11 at 02:28 AM
0

Hi,

Did you refer to the following document?

.NET connection parameters

Thanks,
Atsushi

Share
10 |10000 characters needed characters left characters exceeded