Mimer SQL Documentation PREV NEXT

Mimer Developer Site

www.mimer.com/developer


2.8 More Useful Examples


This section contains a few more useful example calls to SQLConfigDataSource. For more examples, see Example Configuration Program.

2.8.1 Example 1

This is the simplest possible call to create: a system data source, a Mimer SQL database and the system databank, and then start the database server:

rc = SQLConfigDataSource(NULL,ODBC_ADD_SYS_DSN,"MIMER", 
     "DSN=DB6\0" 
     "DATABASE=DB6\0" 
     "DIRECTORY=C:\DB6\0" 
     "SDBGEN=-pSYSPSW DB6\0" 
     "DBSERVER=START\0\0"); 

2.8.2 Example 2

The following call passes control to the user to perform all customization of a database.

The user may not change the data source name (as governed by the specification of SQLConfigDataSource), so the application knows how to connect to the database through the application defined data source name:

rc = SQLConfigDataSource(hWnd,ODBC_ADD_SYS_DSN,"MIMER", 
     "DSN=FIXEDDSN\0" 
     "DATABASE=\0" 
     "DIRECTORY=\0\0"); 
 

Please note that specifying an empty DIRECTORY allows SQLConfigDataSource to identify that a local database should be created.

2.8.3 Example 3

In this example, the database server is stopped and then the definition is deleted along with the data source definition.

rc = SQLConfigDataSource(NULL,ODBC_REMOVE_SYS_DSN,"MIMER", 
     "DSN=DB6\0" 
     "DATABASE=DB6\0" 
     "DBSERVER=STOP\0\0"); 

2.8.4 Example 4

This example demonstrates how to remove a Mimer SQL license key.

rc = SQLConfigDataSource(NULL, ODBC_REMOVE_SYS_DSN, 
     "MIMER", 
     "InstallationNo=1234\0\0"); 

2.8.5 Example 5

This example demonstrates how to remove an ODBC data source.

rc = SQLConfigDataSource(NULL, ODBC_REMOVE_SYS_DSN, 
     "MIMER", 
     "DSN=DB8\0\0"); 


Upright
Mimer Information Technology AB
Voice: +46 18 780 92 00
Fax: +46 18 780 92 40
info@mimer.se
Mimer SQL Documentation PREV NEXT