Back to getting vServer Office to execute in LiveCode Server - successful - with attached scripts and log

Barry G. Sumpter barrysum at bigpond.net.au
Fri Mar 9 17:55:04 CST 2012


Ruslan,
Hi Barry,

So connection was not established?

1)  VSERVER is running? You can check Vserver/logs folder To see what is
there.

Log:
ERROR: Licence license_win_442169285699aaaa is expired.
Licence license_win_442293295212bbbb is registered to cccccccc.
Valid until 9999-12-31. Subscription valid until 2012-04-30.


Error for license aaaa is expired
But license bbbb is still ok.

Yeah, good catch.  Is there anything I can do in script to catch this and
display a message
Instead of just failing?
Or perhaps have an error routine that will simple display the content of the
latest log file?

I've removed the licenses that has expired and restarted the server - log
file does NOT show the Error: line anymore.

----
Also during development in the vserver ini file it is better set
      VerboseLevel = 3

http://www.valentina-db.com/dokuwiki/doku.php?id=valentina:faqs:vsrv&s[]=vse
rver&s[]=ini
http://www.valentina-db.com/dokuwiki/doku.php?id=valentina:products:vserver:
manual:ini_file

The actual ini file is NOT: vServer.ini 
It is: VServer_Office.ini
M:\Program Files\Paradigma Software\VServer Office\VServer_Office.ini

Can we please update the doco?



Updated my VServer_Office.ini and saved and restarted server.

Updated my LCvDB.lc with more debugging displays.

Now displaying:
3/10/12
10:20 AM
Finished: valentina_initclient

Starting ShowError
Finished ShowError

Finished: showError

DatabaseCreate: the gClient of this stack is true ----------
Finished: DatabaseCreate: VConnection_Constructor
Finished: DatabaseCreate: VConnection_Constructor - mConn:14164448
Finished: DatabaseCreate: VConnection_Open
Starting ShowError
Finished ShowError
Finished: DatabaseCreate: ShowError
Finished: DatabaseCreate: VDatabase_Constructor
Starting ShowError
Finished ShowError
Finished: databasecreate

mDatabase: 14165160 mConn:14164448
Finished: mDatabase
Finished: databaseClose
valentina_shutdown 0
Finished: valentina_shutdown


No errors now - I don't know why.
Maybe it was the expired license removal or multiple vServer restarts?

With Valentina Studio:
Server (menu)| Connect to ...| 
Bookmark = Valentina Server | 
DataSrouce = Valentina Server | 
Host =  localhost | 
User = sa | 
Password = sa | 
Connect

vStudio Datasources now shows localhost 
And Connection elements shows database1 and its tables and fields

And the physical file(s) for Database1 is located here:
M:\Program Files\Paradigma Software\VServer Office\databases


I've attached the working LiveCode using Valentina DB Server script.


----
Then you will see more info in the vserver.
Intresting now to see in the log

       ......... Connection established ...

Sat Mar 10 2012 10:08:33.937000 (TID 2764): (UID 516) Connection established
with '127.0.0.1:2665'. ( Connections available: 'unlimited')


-----

2) also you must be able set ON V4REV  debugging log instead write own
    put "string" message

Right after Valentina init do
  get Valentina_DebugLevel( "kLogParams" )  << please check PDF for right
syntax

Yes, already there:

function InitValentina   
...
   get Valentina_DebugLevel("kLogParams")  
end InitValentina


And near to app (I think this time this is RevServer) will brea created
V4REV_Log.txt file  with all calls to external...
Yes, located here:
M:\Inetpub\wwwroot\V4REV_Log_20120310_102005.log
I've attached this log file as well.

------
Hi Mike,

I've been messing around so much I don't recall which version of the
livecode-server script I sent you.  
Looking at the one you posted I think I sent the wrong one!

No prob, pretty sure I've got this working now.


The order is wrong, you'll want to declare all the commands and functions
FIRST and then actually call them, otherwise they don't yet exist in memory
yet and this can cause issues. (at least so it seems to me.

I've attached LCvDB.lc which I feel is working with command then functions.
I'll test again with a different db name to make sure.

The revised script is here. 
It doesn't do much, just tries to connect, determines if the open failed, 
if it did, creates the db and structure instead, then closes itself out.

Big, big thanks for posting script.
Will have a look in detail if mine stops working.

--declare all handlers first
on DatabaseCreate
if the gClient of this stack is true then
    put VConnection_Constructor( "localhost", "sa", "sa") into mConn
    get VConnection_Open( mConn )
   get ShowError()
    put VDatabase_Constructor( mConn ) into mDatabase
  else
    put VDatabase_Constructor() into mDatabase
  end if

  get VDatabase_Open( mDatabase, "database1" )
   get ShowError()
  if VDatabase_ErrNumber( mDatabase ) is not "0" then
    if VDatabase_ErrNumber( mDatabase ) is not "532480" then
      get VDatabase_Create( mDatabase, "Database1", "kDscDatBlbInd" )
      get showError()
      CreateStructure
    else
      answer VDatabase_ErrString( mDatabase )
      close the defaultStack
    end if
  end if

  put VDatabase_Table( mDatabase, "Person" ) into mPerson
  put VTable_Field( mPerson, "FirstName" )  into mFirstName
  put VTable_Field( mPerson, "LastName" )  into mLastName
  put VTable_Field( mPerson, "BirthDate" )  into mBirthDate

end DatabaseCreate


on DatabaseClose
    get VDatabase_Close( mDatabase )
    put VDatabase_Destructor( mDatabase ) into mDatabase end DatabaseClose

on CreateStructure
   put VDatabase_CreateTable(mDatabase, "Person") into pTable

   get VTable_CreateVarcharField( pTable, "Name", 1022, "fIndexed" )
   get VTable_CreateVarcharField( pTable, "LName", 1022, "fIndexed" )
   get VTable_CreateDateField( pTable, "BirthDate", "fIndexed" ) end
CreateStructure

function ShowError
  put Valentina_ErrNumber() into errCode
  put Valentina_ErrString() into errString

  if errCode <> 0 then
    show message box
    put errString into message
  end if
end ShowError

-- then go through the steps.  init, then check for error (using the
showError function)
   get valentina_initclient()
   get showError()

-- call the databasecreate handler
   databasecreate
-- a curiosity check of the current contents of mDatabase && mConn
-- could do a showError here also
   put mDatabase && mConn

-- call the databaseclose handler and shutdown, then put the result of the
shutdown. (should be 0)
   databaseClose
   get valentina_shutdown
   put it && the result
-- I think I mentioned, but I have vserver running in manual mode from the
--command line so I can watch the connection establish do its thing
-- and disconnect, live on the console.
?>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.macserve.net/pipermail/valentina/attachments/20120309/96364300
/attachment.html>

------------------------------

_______________________________________________
Valentina mailing list
Valentina at lists.macserve.net
http://lists.macserve.net/mailman/listinfo/valentina


End of Valentina Digest, Vol 111, Issue 13
******************************************
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LCvDB.lc
Type: application/octet-stream
Size: 5201 bytes
Desc: not available
URL: <http://lists.macserve.net/pipermail/valentina/attachments/20120310/f7943467/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: V4REV_Log_20120310_102005.log.url
Type: application/octet-stream
Size: 81 bytes
Desc: not available
URL: <http://lists.macserve.net/pipermail/valentina/attachments/20120310/f7943467/attachment-0001.obj>


More information about the Valentina mailing list