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.

In this work, I want to connect my Python 3.9.0 to SQL Anywhere 11. I use a module that I got from this github repository. I want to ask about a line of code in this github repository that I found.

conn = sqlanydb.connect(uid='dba', pwd='sql', eng='demo', dbn='demo' )

What is the meaning of the eng parameter and dbn parameter statements? How do I find the identity of the parameter in my SQL Anywhere? Thank you

asked 20 May, 04:08

siahaanryan's gravatar image

accept rate: 0%

Note that SQL Anywhere 11 reached EOMM 31.05.2014.

Here is the basics of connections

dbeng11 -n <eng_name> Database1.db -n <database_name> Database2.db -n <database_name>

The first -n in a database server startup command is the engine (or server name) and the subsequent -n(s) following a database file is the database name. Note: You can run multiple databases on the same engine.

conn = sqlanydb.connect(uid='dba', pwd='sql', eng='<engine_name>', dbn='<database_name>' )

In the absence of -n, the server will be named the same as the first database started. The database name would be the database file name without path and extension.

dbeng11 Database1.db

The engine is Database1 and the database name is Database1. If the database is named as in:

dbeng11 Database1.db -n MyFirstDatabase

the engine name would be the same as the database name or MyFirstDatabase.

Please refer to the SQL Anywhere Server Database Administration book and specifically the Starting and Connecting to your Database for additional information.

permanent link

answered 20 May, 12:32

Chris%20Keating's gravatar image

Chris Keating
accept rate: 31%

Beside of basic connections, did you know how to check the engine from ODBC Data Source ( 64-bit ) ? Becasue in my basic connections to the Data base, the command is like,

dbeng11 -c<parameter> D:\<to database="" path="">\database.db there is no "-n" in there.

(20 May, 20:26) siahaanryan

I do not have ready access to a SQLA 11 DSN. If you are supplying the database file in the DSN, it is being configured to autostart. It is still best practice to provide an engine name and database name. If all that you have is the credentials and database file, the engine name would be the database name and the database name would be the db file name without the .db extension. lets assume that the database file is MyDatabase.db so the database name would be MyDatabase and the engine name would be MyDatabase. All of this is covered in detail in the documentation that I suggested. Here is a link to SyBooks whihc has SQL Anywhere 11 documentation:

(20 May, 21:46) Chris Keating
Replies hidden

Ok, thank you for your answer and information

(20 May, 23:37) siahaanryan

FWIF, the SQL Anywhere 11 help is also available on the SAP Help Portal as a bunch of PDF files:

(21 May, 03:15) 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: 20 May, 04:08

question was seen: 342 times

last updated: 21 May, 03:15