SqlINI SqlDon

Discussion forum about all things SqlBase.
ajthomas12
United States of America
Posts: 51
Joined: 03 Apr 2018, 00:03
Location: USA

SqlINI SqlDon

Post by ajthomas12 » 11 Jun 2014, 00:12

Hello,

I am in need of being able to call SqlDon( ) and SqlINI( ) from within my app to reinitialize the app to use a different database server than what the app first connected to.

At present I am getting 'Undefined function: SqlDon' and 'Undefined function: SqlINI' when I try to run / compile my app.

What library / apl do I need to declare / include to be able to run these functions from within my Team Developer 6.0 app... or is it not even possible and that is not what these functions are for.

Thanks for your help in advance.

~AJ

Scott
Australia
Posts: 415
Joined: 13 Mar 2017, 23:31
Location: Sydney, Australia

Re: SqlINI SqlDon

Post by Scott » 11 Jun 2014, 05:48

You declare them under sqlwntm.dll. I don't have a sample for those specific calls, but here's a few that may help.

Code: Select all

!!CB!! 81
Library name: sqlwntm.DLL
   ThreadSafe: No
   Function: sqlcre
      Description: Create database ( serverhandle, databasename, name length )
      Export Ordinal: 0
      Returns
         Number: WORD
      Parameters
         Number: WORD
         String: LPSTR
         Number: WORD
   Function: sqlded
      Description: Deinstall database
      Export Ordinal: 0
      Returns
         Number: WORD
      Parameters
         Number: WORD
         String: LPSTR
         Number: WORD
   Function: sqlind
      Description: Install database
      Export Ordinal: 0
      Returns
         Number: WORD
      Parameters
         Number: WORD
         String: LPSTR
         Number: WORD
   Function: sqlcsv
      Description: Connect to server
      Export Ordinal: 0
      Returns
         Number: WORD
      Parameters
         Receive Number: LPWORD
         String: LPSTR
         String: LPSTR
   Function: sqldsv
      Description: Disconnect from server
      Export Ordinal: 0
      Returns
         Number: WORD
      Parameters
         Number: WORD

Christof
Germany
Posts: 191
Joined: 06 Mar 2017, 07:27
Location: Frankfurt, Germany

Re: SqlINI SqlDon

Post by Christof » 11 Jun 2014, 07:49

SqlINI is a variable which can be set to point to the sql.ini being used before a first database connection is made.
To switch between different sql.ini files, you need to disconnect all cursors firstly, then change the variable SqlINI, then do new connections.

I've never heared about a function or variable named SqlDon.

frevelundfey

Re: SqlINI SqlDon

Post by frevelundfey » 11 Jun 2014, 08:40

Hi AJ,

it looks like you try to call SQL-api-functions (located in sqlwntm.dll) from within a TeamDeveloper .app.
Technically this is possible when you include the dll as external functions.

But it's much easier to do it this way:
Before you connect to an other DBMS, just set the systemvariables SqlDatabase, SqlUser, SqlPassword.
If you want to disconnect from the other DBMS first then call SqlDisconnect(..) for all connected Cursors.
Don't forget to call SqlClearImmediate() which clears the "hidden" SqlHandle that is implicitly connected with SqlImmediate(..)

Regards Thomas

ajthomas12
United States of America
Posts: 51
Joined: 03 Apr 2018, 00:03
Location: USA

Re: SqlINI SqlDon

Post by ajthomas12 » 12 Jun 2014, 18:11

Thanks all,

We came up with a work around that doesn't require us to change the DBMS while the app is running.

But if I need it in the future I'll attempt to use your suggestion Thomas...

I think the SqlClearImmediate was the piece I was missing.

~AJ

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 0 guests