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

I am currently attempting to query an SQL Anywhere 12 database. I was able to gain access and write queries using the software aqua data studio. Unfortunately, my Aqua Data Studio trial has run out. Any other software that I use (Sybase Central, ODBC, Altova DatabaseSpy, SQL anywhere Client) all give me the same error: an error occured during the sharedmemory connection attempt. I have no idea why this is happening, and I have even tried turning off the "use shared memory connection" on my DB but to no avail.

I checked my log files and this is what was returned:

09:15:14 Attempting to connect using: UID=DBA;PWD=;DBN=;DBF=;ServerName=;CON='*';ASTOP=YES;INT=NO;ENC=NONE;LOG=cli‌​ent.txt

09:15:14 Attempting to connect to a running server...

09:15:14 Attempting SharedMemory connection (no sasrv.ini cached address)

09:15:14 Failed to connect over SharedMemory

09:15:14 Cannot connect to server

Which sounds like an issue with the sasrv.ini being absent. Does anyone know why? Why was aquadata studio able to connect but these others were not? (I had tried other software before aquadata and got the same error)

How can I fix this issue?

asked 28 Jan '14, 11:39

Abrown123's gravatar image

Abrown123
16112
accept rate: 0%

As Reimer has pointed out, your issue has nothing to do with the existence of sasrv.ini.

What is your exact connection string that you are using? The log contents above imply that you are not giving any password (PWD), database name (DBN), database file (DBF), nor a server name (ServerName). In order to connect to a server and database (on that server) you need to give at least some information in your connection string.

(28 Jan '14, 12:27) Mark Culp

I am giving all of those things. However, I don't really feel comfortable putting them online. I can confirm that they are all correct and valid, because they are the same that I used when I was using Aqua Data Studio.

(28 Jan '14, 12:30) Abrown123
Replies hidden

Some questions:

  • Does the database engine run on the same machine that you try to make the database connection from (otherwise you would have to use TCP/IP)?
  • Does the database engine already run with the desired database, or are you trying to start it with your database client?

Note, you can certainly give the requested connection information string and just change the "private" values to some dummy values, such as "DBN=MyServer;UID=MyUser;PWD=123"...

By not telling us which parameters you are using, we have to guess...

(29 Jan '14, 03:45) Volker Barth

the DB and connection are on the same machine.

the database engine runs with the correct DB, I'm just trying to connect to it to write queries

Here is my connection string:

Driver={Sybase SQL Anywhere 12.0};DefaultDir=mydir;Dbf=databasefile; Uid=username;Pwd=password;Dsn="MyDSN";LINKS=TCPIP

(29 Jan '14, 09:19) Abrown123
Replies hidden

When connecting to an already running database, you would usually not specify "DBF=..." but "ENG=...;DBN=..." (or "SERVER=" instead of "ENG="). Or are these values specified in the ODBC DSN?

FWIW, here's a FAQ on connection trouble-shooting that should be of help:

I'm having trouble connecting to a SQL Anywhere server. How can I fix this?

FWIW2: "DefaultDir" is not a common SQL Anywhere connection parameter - it's not listed here...

(29 Jan '14, 09:33) Volker Barth

The strange thing is that the ODBC is also having the shared memory issue, so trying to connect via DSN just has the same problem (which I realize I am doing that in my connection string, but its important to note).

(29 Jan '14, 09:45) Abrown123
showing 4 of 6 show all flat view

If you're using a Window OS, try this from a command line prompt

dbeng12.exe -x TCPIP -n LOCAL c:\database\dbName.db

where c:\database\dbName.db is the location and name of your db file, LOCAL will be the instance name of the engine (i.e. server name used in ODBC connection)

if the engine starts, you'll see the lightning bolt.

if your OS is 64 bit

from the Windows Run prompt enter, c:\Windows\SysWow64\odbcad32.exe

if your OS is 32 bit, use the ODBC shortcut

ODBC tab, Data source name, enter LOCAL

login tab, enter the UID and PWD

Database tab, Server name enter LOCAL

Network tab, check TCP/IP, unchedk Shared memory

back to ODBC tab, test connection

if your connection is successful, you should be able to connect in iSQL or Sybase Central using the ODBC datasource option

permanent link

answered 29 Jan '14, 10:10

Tom%20Mangano's gravatar image

Tom Mangano
672242738
accept rate: 8%

edited 30 Jan '14, 08:35

Graeme%20Perrow's gravatar image

Graeme Perrow
9.6k379124

If I put the servername as "LOCAL" all I get is an error that says "the server could not be found"

(29 Jan '14, 10:44) Abrown123
Replies hidden

What does DBLOCATE reveal? (Just let it run in a command line)

Note: It does not list database engines that do not listen on TCP/IP ports?

(29 Jan '14, 10:52) Volker Barth

did you start the db with this line? dbeng12.exe -x TCPIP -n LOCAL c:databasedbName.db if you did, you should see the lightning bolt. hover over the lightning bolt, and you should see LOCAL if you don't see LOCAL, you're engine didn't start

(29 Jan '14, 15:44) Tom Mangano

The file sasrv.ini will only cache information to accelerate server lookup, but connections should be possible independent of it's existence.
You might want to try adding LINKS=TCPIP to your connection string.

permanent link

answered 28 Jan '14, 12:07

Reimer%20Pods's gravatar image

Reimer Pods
4.5k384891
accept rate: 11%

When I add that to my connection string, Sybase Central gives "internal error: Sybase Central has encountered a problem and may need to close" and then the application closes

(28 Jan '14, 12:13) Abrown123
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:

×43
×19

question asked: 28 Jan '14, 11:39

question was seen: 7,359 times

last updated: 01 May '14, 03:41