很多站长使用科汛ASP版时,由于数据较多选择使用MSSQL数据库。但是问题来了,使用MSSQL数据库后,发现网站访问速度比AC库慢。下面分享一个解决方案: 修改Asp文件 /conn.asp If DataBaseType = 1 Then 'ConnStr="Provider = Sqloledb; User ID = " & datauser & "; Password = " & databasepsw & "; Initial Catalog = " & databasename & "; Data Source = " & dataserver & ";" ConnStr="Driver={SQL SERVER};Server=" & dataserver & ";UID=" & datauser & ";PWD=" & databasepsw & ";Database=" & databasename & ";" '解决访问SQL数据库时慢 SqlNowString = "getdate()" DataPart_D = "d" DataPart_Y = "year" DataPart_H = "hour" DataPart_S = "s" DataPart_W = "weekday" DataPart_M = "month" Else 备注:红色为增加部分 |