| Author |
Topic Search Topic Options
|
Ritchie
Groupie
Joined: 14 June 2005
Location: Russian Federation
Status: Offline
Points: 91
|
Post Options
Thanks(0)
Quote Reply
Topic: Updating up to version 8.0 bug Posted: 21 March 2006 at 1:43pm |
Greetings, Borg! After updating a database of a forum from version 7.96 to version 8.0 has found out a mistake. The statistics of a forum is incorrectly displayed:
Was before updating:
Posts:188449 Topics: 15309 Forums: 19
Became after updating:
Posts:367013 Topics: 30144 Forums: 33
|
|
Чем дальше в лес, тем толще партизаны
|
 |
WebWiz-Bruce
Admin Group
Web Wiz Developer
Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
|
Post Options
Thanks(0)
Quote Reply
Posted: 21 March 2006 at 1:48pm |
|
You have not mentioned what database version you are using?
Also, are the number of forums correct, a sit looks like you have picked up extra forums from somewhere.
Another trick is to try posting in some of the forums and see if that corrects the forum statistics.
Do you have a URL to this so that I can have a look?
|
 |
Ritchie
Groupie
Joined: 14 June 2005
Location: Russian Federation
Status: Offline
Points: 91
|
Post Options
Thanks(0)
Quote Reply
Posted: 22 March 2006 at 7:59am |
I used version MSSQL 7.96. Tested on a local computer, therefore the link I can not give. A problem that the following code adds in the table tblPermission data who are duplicated.
'Loop through each forum Do While intForumLoopCounter <= Ubound(iarryForumID,2) 'Reset permissions loop counter lngPermissionsLoopCounter = 0 'Loop through topics and to populate the topics table Do While lngPermissionsLoopCounter <= Ubound(iaryGroupID,2) 'Get the gorup ID 'See if a record exists for this group in the permissions table strSQL = "SELECT " & strDbTable & "Permissions.Group_ID " & _ "FROM " & strDbTable & "Permissions " & _ "WHERE " & strDbTable & "Permissions.Group_ID = " & CLng(iaryGroupID(0,lngPermissionsLoopCounter)) & " " & _ "AND " & strDbTable & "Permissions.Group_ID = " & CLng(iarryForumID(0,intForumLoopCounter)) & ";" 'Query the database rsCommon.Open strSQL, adoCon 'If no record is returned insert a new record in the database If rsCommon.EOF Then blnRead = strDBTrue If CLng(iaryGroupID(0,lngPermissionsLoopCounter)) = 2 Then blnPost = strDBFalse Else blnPost = strDBTrue 'not guest If CLng(iaryGroupID(0,lngPermissionsLoopCounter)) = 2 Then blnReply = strDBFalse Else blnReply = strDBTrue 'not guest If CLng(iaryGroupID(0,lngPermissionsLoopCounter)) = 2 Then blnEdit = strDBFalse Else blnEdit = strDBTrue 'not guest If CLng(iaryGroupID(0,lngPermissionsLoopCounter)) = 2 Then blnDelete = strDBFalse Else blnDelete = strDBTrue 'not guest If CLng(iaryGroupID(0,lngPermissionsLoopCounter)) = 1 Then blnPriority = strDBTrue Else blnPriority = strDBFalse 'Admin only blnPollCreate = strDBFalse blnVote = strDBFalse blnAttachments = strDBFalse blnImageUpload = strDBFalse blnCheckFirst = strDBFalse blnEvents = strDBFalse blnModerator = strDBFalse 'Insert values into database strSQL = "INSERT INTO [" & strDbTable & "Permissions] ( " strSQL = strSQL & "[Group_ID], " strSQL = strSQL & "[Forum_ID], " strSQL = strSQL & "[View_Forum], " strSQL = strSQL & "[Post], " strSQL = strSQL & "[Reply_posts], " strSQL = strSQL & "[Edit_posts], " strSQL = strSQL & "[Delete_posts], " strSQL = strSQL & "[Priority_posts], " strSQL = strSQL & "[Poll_create], " strSQL = strSQL & "[Vote], " strSQL = strSQL & "[Attachments], " strSQL = strSQL & "[Image_upload], " strSQL = strSQL & "[Moderate]" strSQL = strSQL & ") VALUES (" strSQL = strSQL & CLng(iaryGroupID(0,lngPermissionsLoopCounter)) & ", " strSQL = strSQL & CLng(iarryForumID(0,intForumLoopCounter)) & "," strSQL = strSQL & blnRead & "," strSQL = strSQL & blnPost & "," strSQL = strSQL & blnReply & "," strSQL = strSQL & blnEdit & "," strSQL = strSQL & blnDelete & "," strSQL = strSQL & blnPriority & "," strSQL = strSQL & blnPollCreate & "," strSQL = strSQL & blnVote & "," strSQL = strSQL & blnAttachments & "," strSQL = strSQL & blnImageUpload & "," strSQL = strSQL & blnModerator & ")" 'Write to the database adoCon.Execute(strSQL) End If 'Close recordset rsCommon.Close 'Move to next record lngPermissionsLoopCounter = lngPermissionsLoopCounter + 1 Loop 'Move to the next record intForumLoopCounter = intForumLoopCounter + 1 Loop End If
Accordingly the inquiry in lines default.asp 138-144 files superfluous data.
The code in lines of a file msSQL_server_update.asp works incorrectly. After performance of updating the total of records tblPermission in my database became 749. Before their updating there was 584!
Edited by Ritchie - 22 March 2006 at 8:12am
|
|
Чем дальше в лес, тем толще партизаны
|
 |
WebWiz-Bruce
Admin Group
Web Wiz Developer
Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
|
Post Options
Thanks(0)
Quote Reply
Posted: 22 March 2006 at 11:14am |
|
I see the problem, the SQL query in the beta upgrade tool should be:-
strSQL = "SELECT " & strDbTable & "Permissions.Group_ID " & _ "FROM " & strDbTable & "Permissions " & _ "WHERE
" & strDbTable & "Permissions.Group_ID = " &
CLng(iaryGroupID(0,lngPermissionsLoopCounter)) & " " & _ "AND " & strDbTable & "Permissions.Forum_ID = " & CLng(iarryForumID(0,intForumLoopCounter)) & ";"
I'll make the corrections to the upgrade tool
|
 |
WebWiz-Bruce
Admin Group
Web Wiz Developer
Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
|
Post Options
Thanks(0)
Quote Reply
Posted: 22 March 2006 at 11:17am |
|
I have updated the upgrade tool with the corrections to it to hopefully fix this problem.
|
 |
Ritchie
Groupie
Joined: 14 June 2005
Location: Russian Federation
Status: Offline
Points: 91
|
Post Options
Thanks(0)
Quote Reply
Posted: 22 March 2006 at 7:00pm |
Many thanks! All works!
|
|
Чем дальше в лес, тем толще партизаны
|
 |
WebWiz-Bruce
Admin Group
Web Wiz Developer
Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
|
Post Options
Thanks(0)
Quote Reply
Posted: 23 March 2006 at 10:45am |
|
Cool, thanks for letting me know
|
 |