How do I make a new database?

I know this is basic but…

I exported my solution and saved it someplace where it would not get overwritten. Downloaded and installed RC11. I tried to import my old solution and was told that I needed to create the database. I am stuck because I do not know how to make a new database in iAnyWhere. Do I need to download some tools from I AnyWhere? Which tool do I use to make a new database?

John McCann

Download SQL Anywhere Studio.
There’s a good admin tool in there (Sybase Central)

http://www.ianywhere.com/downloads/sqlany.html

Additional NOTE to the above: after creating the database you must add it to the file sybase.config located in the sybase_db directory.

Sybase Central can be downloaded for free and you can use it for many administrative functions. More documentation about the external tools will appear in the next version of our documentation.

You can also create databases on the command line/prompt:

  1. open a terminal (linux, unix, os x) or a command prompt
  2. change directory to your Servoy installation directory
  3. change directory to the sybase_db directory inside you Servoy directory
  4. a. On mac os x set your DYLD_LIBRARY path to this directory
    Using bash:
export DYLD_LIBRARY_PATH=/path/to/sybase_db

for example:

export DYLD_LIBRARY_PATH=/Applications/Servoy/sybase_db

Using tcsh:

setenv DYLD_LIBRARY_PATH /path/to/sybase_db

example:

setenv DYLD_LIBRARY_PATH /Applications/Servoy/sybase_db

b. On Linux/Unix:
Using bash:

export LD_LIBRARY_PATH=/path/to/sybase_db

for example:

export LD_LIBRARY_PATH=/usr/local/servoy/sybase_db

Using tcsh:

setenv LD_LIBRARY_PATH /path/to/sybase_db

example:

setenv LD_LIBRARY_PATH /usr/local/servoy/sybase_db

c. On Windows:

set ASANY9=\path to sybase_db

for example:

set ASANY9=c:\Program Files\Servoy\sybase_db 
  1. create the database using the following command:
    a. On OS X, Linux and Unix:
./dbinit -t <name>.log -z UTF8 <name>.db

b. On windows:

dbinit.exe -t <name>.log -z UTF8 <name>.db

add the databse to the sybase.config file in the sybase_db directory. If you created the database in the database directory create a line like this:

database/mydb.db

if you created it somewhere else put the full path to the database in the config file.

Finally make sure you have stopped the database server for it to automatically start the database when Servoy launches. On Windows: right click the SQL tray icon and choose Exit. On Mac, Linux, Unix: kill the dbsrv* processes. You can also stop the database using dbstop in the sybase_db directory:

./dbstop -c "eng=servoy_repository;uid=DBA;pwd=SQL"

I’m having trouble doing this: I have created a new database in the servoy_repository server using sybase central which seems to go fine - the new databse is listed in the servoy_repository tree along with crm etc. , I have then added the name to the sybase_db file but cannot create a connection from servoy prefs - I get a login failed error (using the standard dba and sql combination) when I try. I cannot see anyway in sybase central to confirm what username and password are being set when a new database is created.

Where am I going wrong?

did you edit the sybase.config file? I assume you did although you say you edited sybase_db. What entry did you add to that file? where is your .db file locate? does the file extension match? did you stop the database server before reconnecting to it in Servoy (close servoy, stop the db server, then launch servoy) dba/sql is the default login.

did you edit the sybase.config file?

Sorry - I did mean the config file. I added the database name ‘flow’ and the .db extension to match the entries for crm etc.

I did not stop the server before attempting to reconnect to servoy - in the end I needed to restart my machine and after the restart the server was not running and I could create the connection. All now working correctly - thanks again for the prompt reply.

OSX 10.3.3
Servoy Developer
R2 2.0 rc13-build 272
Sybase Central 4.2.0.2047
I am experiencing a problem creating a new database using Sybase Central.
I have Servoy loaded with iAnywhere server running and open Sybase Central
I have connected to servoy_repository server and can see : repository, user_data etc databases.
I use the create database wizard and choose to create a database on servoy_repository server.
I choose to create : /Applications/Servoy/database/membership.db
Click on Finish and it runs through its create process and shows as ‘completed’

But, I cannot then see the database within the servoy_repository tree in Sybase Central !
Am I missing out some obvious activity here ?

Thanks
Harry

744U.TXT (3.22 KB)

you don’t need to see it there. In fact by default you won’t see it. All you need to do now is close all apps add the database to sybase.config, stop all sybase processes and relaunch servoy to start using it.

Thanks Jan.

All appeared as it should once I had killed the Sybase process and then opened Servoy and created a DBServer entry.

I still find it disconcerting that you do not see the database in the tree once created in SybaseCentral !

Harry

Harry Catharell:
I still find it disconcerting that you do not see the database in the tree once created in SybaseCentral !

You should if you connect to it.
Click connect (icon in the top icon bar), fill in username and password, on the second tab point to the database file (not server and don’t fill in any other options)

Pardon Jan, I mean that I could not see the database at the point that I had created it within Sybase Central and clicked on the ‘close’ button once Sybase had completed its setup process.

I could connect to and administer the database inside Sybase Central once I had quit the Sybase process, restarted Servoy and then relaunched Sybase Central.