Skip to Content
avatar image
Former Member

.NET Connection String for SQLAnywhere 17

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
Add comment
10|10000 characters needed 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.

  • Get RSS Feed

2 Answers

  • Jan 11 at 08:02 AM

    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)"

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 11 at 02:28 AM

    Hi,

    Did you refer to the following document?

    .NET connection parameters

    Thanks,
    Atsushi

    Add comment
    10|10000 characters needed characters exceeded