|
A quick note... Maybe nothing you have to do...
One of our forums was updated a long time ago from Access to MSSql. Likely all the default values did not carry over. I have had to go in and set default values from time to time. Most of the time it has to do with Null's when it should be a Zero. For example, today I added a new forum to a category, so it obviously did not have any posts in it. Upon adding it, I got a forum error:
Microsoft VBScript runtime error '800a005e'
Invalid use of Null: 'CLng'
/Forums/default.asp, line 531
So, I just commented out the line that had the error:
lngNumberOfPosts = CLng(sarryForums(7, intCurrentRecord))
Then I made a post, removed the comment, and the error was gone. Of course all I have to do is set a default value of 0 to No_of_posts in the tblForum, which I did also.
But I just wanted to ask is there any easy way of restablishing default values for a MSSql database other than fixing it as I go along and an error occurs? Maybe a simple script that resets default values on the entire forum would be neat. Or a simple sql command to run that would look for all numerical colums and set the default to 0 or going through the entire database manually? But maybe this is not super important because this may not be happening every day. I did want to mention this in case others get the above error after an upgrade from one database type to another... that you MAY have to set default values for fields that expect a number, because a null could fire an error. It does seem that default values are not established when certain conversion tools convert from Acces to MSSql.
Thanks!
Steve
|