版本:Zblog 1.8 Spirit Build 80722
Sql版本:Mssql2000以及Mssql2005均通过
演示:校内网代码 Fend.cn
适用对象:文章较多,数据库较大,有Mssql数据库的Zblogger
步骤如下:
1:Access转入Mssql
(1)在本地导入Access到Mssql数据库
(2)设置
表blog_article字段log_ViewNums默认值为0,
表blog_Category字段cate_Count默认值为0,
表blog_tag字段tag_Count默认值为1.
(3)修改所有表的ID字段(一般都是第一个字段)的标识属性为:
标识:是
标识种子:1
标识增量:1
2:
(1)修改function/c_system_base.asp里的数据库连接为
Function OpenConnect()
GetReallyDirectory()
'判定是否为子目录调用
Dim strDbPath
Dim connstr
strDbPath=BlogPath & ZC_DATABASE_PATH
Set objConn = Server.CreateObject("ADODB.Connection")
connstr="Provider=SqlOLEDB;Data Source=(local);initial catalog=数据库名;user ID=登陆名;password=登陆密码;"
objConn.Open connstr
OpenConnect=True
End Function
(2)在function/c_system_lib.asp里
Call CheckParameter(Istop,"bool",False)
后加上:
if Istop=true then
isTop=1
else
istop=0
end if
在
objConn.Execute("INSERT INTO [blog_UpLoad]([ul_AuthorID],[ul_FileSize],[ul_FileName],[ul_PostTime],[ul_Quote]) VALUES ("& AuthorID &","& FileSize &",'"& FileName &"','"& PostTime &"',"&DirByTime&")")
前加上:
if DirByTime<>"True" then
DirByTime=0
else
DirByTime=1
end if
(3)修改function/c_system_manage.asp里
true=true
为
1=1
(4)修改function/c_system_wap.asp里
objRS("blog_Comment.log_ID")
为
objRS("log_ID")
(5)function目录所有文件
修改
[log_istop]=false
为
[log_istop]=0
并且修改
[log_istop]=True
为
[log_istop]=1
(6)function目录所有文件中,修改sql语句中时间格式#改为'
提示:此步骤应该谨慎进行
技巧:修改sql语句中时间格式#"和"#附近的(并不局限于#"和"#)#,将其改为'
注意:有一些模板标签也带有#"和"#,这里请不要更换.
3:注意的几点:
(1)原来的Access数据库及其目录需要保留,不要删除.
(2)如果使用列表排行插件,请打开此插件目录里的include.asp,将其中now()修改为 getdate(),原因是sql不支持now()
(3)如使用自动发布插件,请对PubArticles.asp进行2(6)操作
(4)使用批量管理文章插件的需要做如下修改:
修改批量管理文章插件目录下的articleMng.asp
If log_Istop <> -1 Then
If log_Istop = 1 Then
objConn.Execute("UPDATE [blog_Article] SET [log_IsTop]=True WHERE [log_ID] in("& strLog_ID &")")
End If
if log_Istop = 0 then
objConn.Execute("UPDATE [blog_Article] SET [log_IsTop]=False WHERE [log_ID] in("& strLog_ID &")")
End If
End If
为
If log_Istop <> -1 Then
If log_Istop = 1 Then
objConn.Execute("UPDATE [blog_Article] SET [log_IsTop]=1 WHERE [log_ID] in("& strLog_ID &")")
End If
if log_Istop = 0 then
objConn.Execute("UPDATE [blog_Article] SET [log_IsTop]=0 WHERE [log_ID] in("& strLog_ID &")")
End If
End If
修改批量管理文章插件目录下的articleList.asp
If intIstop<>-1 Then
if intIstop = "1" then
strSQL= strSQL & " AND [log_Istop]=True"
end if
if intIstop = "0" then
strSQL= strSQL & " AND [log_Istop]=False"
end if
End If
为
If intIstop<>-1 Then
if intIstop = "1" then
strSQL= strSQL & " AND [log_Istop]=1"
end if
if intIstop = "0" then
strSQL= strSQL & " AND [log_Istop]=0"
end if
End If
并把此页的true=true修改为1=1
4:未解决的问题:
站内搜索出错,提示为:
错误原因:未知错误 ID:-2147217900 摘要:'LCase' 不是可以识别的 内置函数名称。Microsoft OLE DB Provider for SQL Server
其他方面的问题暂未发现,有兄弟发现请多交流,谢谢!特感谢termjoy和密陀僧,尤其是termjoy大哥,对偶提供热心的技术帮助,感谢!