• Welcome, Guest. Please login.
 
July 13, 2020, 01:54:16 am

News:

Welcome to the SQLitening support forums!


slConnect's wsOutData parameter

Started by Bern Ertl, April 17, 2013, 04:59:08 pm

Previous topic - Next topic

Bern Ertl

Finally got around to investigating the issue I was having with strange behavior for a log in system that I implemented using SQLitening's server exits and a table to monitor active connections.  SQLitening.Txt states:
QuoteslConnect                  ([rsServer String, rlPort Long, rsModChars String, wsOutData String]) Long
...
   OutData, if parm is passed and if return is zero, will contain the
   following values delimited by the $BS character.  There is only one
   value being returned now but others may be added in future so use the
   parse$ command.
      1 = The unique TcpFileNumber assigned by the server to this connection.  This
          can be used whenever a unique number for a connection is needed.  This
          same value is passed to ceratin exits.
...


My code had:

lResult = slConnect( "LocalHost", 0, "E2", sConHandle)
<check lResult>
sConHandle = PARSE$( sConHandle, $BS, 1)

I was expecting sConHandle to be '1' or '4' or something like that.  It's always returning an empty string though.

I checked SQLiteningServer.BAS : ProcessRequest() and the %reqConnect handler is not adding the required data (for bytes 7-?).

I made the following modifications to SQLiteningServer.BAS : ProcessRequest() and it is now functioning as expected:   case %reqConnect
'      wsDataOut = mki$(0) & mkdwd$(Connect_(rsDataIn))   'Original code

      wsDataOut = mki$(0) & mkdwd$(Connect_(rsDataIn)) & FORMAT$( rlTcpFileNumber)  'Modified to return connection handle



Paul Squires

Thanks Bern, based on your advice I have updated the master code base for SQLitening. Your fix will be in the next release. Thanks for sharing.


Bern Ertl


cj

Thanks, Bern.
I downloaded the latest version, but noticed this fix is not in there.

cj

Tip of the month:
When disconnecting from a remote database I was doing this:
slclose
sldisconnect

This will work most of the time, but if for some reason there is no connection
sqlite3.dll will be needed to issue the slclose and it won't be to the remote database.

Bottom line:
sldisconnect





Bern Ertl

Quote from: cj on July 17, 2015, 12:33:43 am
Thanks, Bern.
I downloaded the latest version, but noticed this fix is not in there.


Version 160_5 available in the download thread shows a last update of Feb. 2013.  My update above was posted in April.  Looks like 160_5 was not updated yet.