|
作者: wuhuan [wuhuan] 论坛用户 | 登录 |
<% Dim objConn Function GetRecordset(FileName, TableName) '使用Connection对象打开数据库文件 Set objConn = Server.CreateObject("ADODB.Connection") objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=" & Server.MapPath(FileName) objConn.Open '从数据表中读取记录并存放在Recordset对象中 Set GetRecordset = Server.CreateObject("ADODB.Recordset") GetRecordset.Open TableName, objConn, adOpenKeyset, adLockOptimistic, adCmdTable End Function Function GetSQLRecordset(strSQL, FileName, TableName) '使用Connection对象打开数据库文件 Set objConn = Server.CreateObject("ADODB.Connection") objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=" & Server.MapPath(FileName) objConn.Open '从数据表中读取符合SQL语句的记录并存放在Recordset对象中 Set GetSQLRecordset = Server.CreateObject("ADODB.Recordset") GetSQLRecordset.Open strSQL, objConn, adOpenKeyset, adLockOptimistic, adCmdText End Function Function GetSecureRecordset(FileName, TableName, Password) '使用Connection对象打开数据库文件 Set objConn = Server.CreateObject("ADODB.Connection") objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=" & Server.MapPath(FileName) & _ ";Jet OLEDB:Database Password=" & Password objConn.Open '从数据表中读取记录并存放在Recordset对象中 Set GetSecureRecordset = Server.CreateObject("ADODB.Recordset") GetSecureRecordset.Open TableName, objConn, adOpenKeyset, adLockOptimistic, adCmdTable End Function %> |
地主 发表时间: 05/16 16:14 |
|
20CN网络安全小组版权所有
Copyright © 2000-2010 20CN Security Group. All Rights Reserved.
论坛程序编写:NetDemon
粤ICP备05087286号