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=client.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 |
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 answered 29 Jan '14, 10:10 Tom Mangano Graeme Perrow 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. answered 28 Jan '14, 12:07 Reimer Pods 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
|
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.
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.
Some questions:
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...
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
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...
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).