帮我解释一下这段代码吧

lvjie630 2007-06-07 03:39:06
Public Function query(sql)

'time_start = timer()
Set query = Conn.Execute(sql)
'time_end = timer()

'dim time_str
'time_str = time_end-time_start

'dim str
'str = "["&now()&"][sql]("&time_str&") "&sql
'dim fs,hf
'set fs = CreateObject("Scripting.FileSystemObject")

'set hf = fs.OpenTextFile(server.mappath(webroot&"debug\sql.log"), 8, TRUE)

'hf.Write(str)& vbcrlf

'hf.close
'set hf = nothing
'set fs = nothing

End Function
...全文
175 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
astly2004 2007-06-07
  • 打赏
  • 举报
回复
Public Function query(sql) 查询函数,参数是sql语句

'time_start = timer() 开始时间
Set query = Conn.Execute(sql) 将Conn.Execute(sql) set 给变量query
'time_end = timer() 结束时间

'dim time_str
'time_str = time_end-time_start 时间差

'dim str
'str = "["&now()&"][sql]("&time_str&") "&sql 字符串拼接
'dim fs,hf
'set fs = CreateObject("Scripting.FileSystemObject") 创建文件对象

'set hf = fs.OpenTextFile(server.mappath(webroot&"debug\sql.log"), 8, TRUE) 打开log文件

'hf.Write(str)& vbcrlf 写入log 并且换行

'hf.close 关闭文件
'set hf = nothing 释放对象
'set fs = nothing 释放对象

End Function

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧