There are default values for all fields so fields don't need to be nullable. Not sure about the exact error you're seeing. I'd guess it has to do with the zero default. I have to take a look when I get a chance to double check.
+++ Rick ---
That generates SQL errors:
. Incorrect syntax near the keyword 'DEFAULT'.
... and ...
. Incorrect Syntax. 'Create Default' must be the only statement within the batch
I have also discovered that the root cause of the problem is that in wwServer.LogRequest, you do an INSERT into wwRequestLog without specifying the 'referrer' and 'result' values - resulting in as SQL error with no data being logged:
lnResult = THIS.oSQL.Execute( "INSERT INTO wwRequestLog" + ;" (QueryStr ,REMOTEADDR, Duration,Error,Script,MemUsed,ReqId)" + ;" VALUES (?lcParameter,?lcRemoteAddress,?lnSeconds,?llError,?lcExecutable," +;"'" + SYS(1016) + "',?lcReqId)" )
The table definition for wwRequestLog has a data type with "not null" for those two fields.
Is it possible that wwServer is out of date? My console window shows version 5.64 - or perhaps no-one else has noticed?
BTW - Merry Christmas and Aloha!
The Console uses a template for the SQL table creation which lives in:
templates\westwind.sql
I just took a look and it looks like this is what's causing your problems:
ifexists (select * from dbo.sysobjectswhere id = object_id(N'[dbo].[UW_ZeroDefault]') andOBJECTPROPERTY(id, N'IsDefault') = 1)dropdefault [dbo].[UW_ZeroDefault]GOCREATEDEFAULT UW_ZeroDefault AS 0
Maybe you can comment that out. Or better yet: maybe we should re-write that to (and you try it in your database):
ifNOTexists (select * from dbo.sysobjectswhere id = object_id(N'[dbo].[UW_ZeroDefault]') andOBJECTPROPERTY(id, N'IsDefault') = 1)CREATEDEFAULT UW_ZeroDefault AS 0GO
+++ Rick ---
Up to now, I have been using a single SQL database for both the webconnect session logs AND my application data.
Unfortunately, this is creating problems as I try to re-create the session logs as their structure gets updated. The console will not update the structure if the tables already exist. I can delete the ww_tables and associated SQL objects - EXCEPT the UW_ZeroDefault default because it is also associated with some of my other tables (apparently it's associated with the upsizing wizard, which I used to migrate data from VFP to SQL).
The Console fails, complaining that UW_ZeroDefault already exists.
So... after several attempts at this, my app cannot write to the log file due to the fact that 'null values are not allowed' in several columns so I must have screwed up the sql table structures.
What is everyone else doing? Should I just manually update the wwRequestLog when the structure changes rather than just doing it from the Console? Should I use separate databases for data and logs so I can easily delete and re-create the session logs?
TIA
Happy Holly-Days!
West Wind Technologies
Making waves on the Web