ASP自定义函数,仿VBA中域函数 DLookup
来源:互联网 发布:下载视频软件 知乎 编辑:程序博客网 时间:2024/06/08 20:00
Function DLookup(strFieldName, strTableName, strWhere, objConn)
'参考Access VBA 中的DLookup函数
'由于环境不同,加了ObjConn参数,直接将Adodb.connection直接调进来
Dim strsql
Dim rs
Set rs = server.CreateObject("adodb.recordset")
'下面要调用外部的一个自定义函数 checksql()
strFieldName = checksql(strFieldName)
If strWhere <> "" Then
strWhere = " where " & strWhere
End If
strsql="select "&strfieldname&" from "&strtablename&" " & strwhere
'debugstop strsql
On Error Resume Next
rs.Open strsql, objConn, 1, 1
If Err <> 0 Then
response.write Err.Description
response.end()
End If
If rs.EOF And rs.BOF Then
DLookup = ""
Else
'要调用一个自定义函数 NZ
'详细内容请参考 ACCESS VBA 帮助中的资料
DLookup = Nz(rs(strFieldName), "")
End If
rs.Close
End Function
- ASP自定义函数,仿VBA中域函数 DLookup
- ASP自定义函数,仿VBA中域函数 DLookup
- 自定义函数,仿VBA中域函数DLookup
- Dlookup函数综合释疑
- vba自定义功能函数
- Excel自定义函数VBA
- 【VBA研究】VBA中使用vlookup函数
- 【VBA研究】VBA中编写延时函数
- vba中数据类型转换函数
- 【VBA研究】VBA自定义函数参数类型不符的错误
- asp中自定义截取字段函数StrLeft()
- VBA第7课 编写自定义函数
- VBA自定义函数-选择文件对话框
- VBA自定义函数-选择文件夹对话框
- VBA自定义函数-打开文件对话框
- VBA自定义函数-保存文件对话框
- VBA函数
- VBA 函数
- C# 2.0 Specification (泛型四)
- 用 Access 分析网站一例
- 让Asp.Net输出图形
- 如何使Microsoft SQL Server的日志文件不会增大
- VB.NET:又将是个跨越十年的美丽...
- ASP自定义函数,仿VBA中域函数 DLookup
- VB.net中HOOK的应用(CNET中文网)
- 数据库管理员DBA
- winform里的treeview能够跟数据绑定吗?我不知道。里面有treeview的用法。是转来的
- 批量将一个库里的所有表里的char改成nchar类型
- 转:设计模式Singleton(例子是C#的)
- Oracle Optimizer:迁移到使用基于成本的优化器-----系
- 微软的远程处理框架.NET Remoting(转天极网)之一
- 现实中的细粒度审计(2)