cancel
Showing results for 
Search instead for 
Did you mean: 

Starting SQLAnywhere from c api?

Former Member
0 Kudos
2,777

Folks,

Just wondering if it is possible to spawn a new database engine instance from within the c-api?

I want to be able to do something like this from within my application

dbspawn dbeng12 -n Test1 /Users/DCleyne/Test1.db

Cheers,

Dan

Accepted Solutions (1)

Accepted Solutions (1)

MarkCulp
Participant

You can use the DBF connection parameter to specify the pathname to the database file and the client library will start an engine automatically if needed.

Example:

res = api.sqlany_connect( conn, "uid=dba;pwd=sql;dbf=/Users/DCleyne/Test1.db" );

Also take a look at the START connection parameter.

This topic on locating a server in the docs also talk about auto-starting a database.

Former Member
0 Kudos

That's excellent!

Thanks Mark

Answers (0)