Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in August and this forum will be retired.

I am using DSN files with Adaptive Server Anywhere 17. I am having problems using the INITSTRING entry to authenticate the database. It appears that the embedded semicolon is terminating the necessary command and needs to be escaped. Here's (with authentication information removed) the DSN file entry:

INITSTRING=”SET TEMPORARY OPTION connection_authentication='Company=MyCompany;Application=MyApplication;Signature=aaaaaaaaaaaabbbbbbbbbbbbbbbbccccccccccccccccdddddddddddddddddddddeeeeeeeeeeeeefffff’;”
In the dbsrv17 logs, this is interpreted like this:
=,<,1,PREPARE,”SET TEMPORARY OPTION connection_authentication='Company=MyCompany
+5,E,1,-131,Syntax error near '”' on line 1
Clearly, the statement is truncating at the semicolon.

Does anyone know how I can restructure this DSN file entry do the statement is not truncated?

asked 24 Aug '17, 11:10

s0183616's gravatar image

accept rate: 0%

edited 24 Aug '17, 11:47

Mark%20Culp's gravatar image

Mark Culp

Figured it out. Surround the command with {} characters. For my example, the entry would be:

INITSTRING={SET TEMPORARY OPTION connection_authentication='Company=MyCompany;Application=MyApplication;Signature=aaaaaaaaaaaabbbbbbbbbbbbbbbbccccccccccccccccdddddddddddddddddddddeeeeeeeeeeeeefffff’;}

permanent link

answered 24 Aug '17, 12:52

s0183616's gravatar image

accept rate: 0%

It might also work if you had used the ordinary " characters instead of the funky ” characters... after all, that's what the error message said :)

(24 Aug '17, 13:42) Breck Carter

Wild guess: The following relates to ODBC connection strings in .NET but does also explain the use of curly braces to escape particular chars...

OdbcConnection.ConnectionString Property

(25 Aug '17, 15:20) Volker Barth
Your answer
toggle preview

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 24 Aug '17, 11:10

question was seen: 1,791 times

last updated: 25 Aug '17, 15:20