• 网络学院
  • IT资讯
  • 操作系统
  • 网络技术
  • 软件应用
  • 办公软件
  • 编程技术
  • 网站架设
  • 数据库类
  • 平面设计
  • 多媒体类
  • 游戏资讯
  • 教学论文
  • 认证考试
使用NextRecordset通过一个Connection输出多个select查询
  站点:
  • 首 页
  • 最新软件
  • 文章教程
  • 国内软件
  • 国外软件
  • 绿色软件
  • 源码下载
  • 字体下载
使用NextRecordset通过一个Connection输出多个select查询
软件发布 使用NextRecordset通过一个Connection输出多个select查询
网络软件 系统工具 应用软件 联络聊天 图形图像 多媒体类 行业软件 游戏娱乐 编程开发 安全相关 教育教学 数码软件 绿软下载
热门软件: QQ 瑞星 pplive e话通 木马克星 千千静听 office2000 五笔字根 Photoshop 视频分割
返回文章教程首页 >> 文章首页 >> 编程技术 >> ASP & ASP.NET教程 >> 使用NextRecordset通过一个Connection输出多个select查询

使用NextRecordset通过一个Connection输出多个select查询

添加时间: 2006-5-7 2:49:31  作者: ASP教程  阅读次数:81   来源: http://d9soft.com

        <%
dim conn
dim strconn
dim rs
dim strsql
dim strsql2
dim strsql3
dim strsql4
dim strsql5
dim strsql6
dim strsql7
dim strsql8

'strconn = Driver={SQL Server};Description=example;SERVER=222.222.1.2;UID=webexample;PWD=;DATABASE=webexample"


'Format Declare & EXEC statements that will be passed
'to the database with the output parameters
strsql = "DECLARE " & CHR(10) & "@Id_Req " & "INT" & CHR(10)
strsql2 ="exec " & "sp_EmpInfo" & " '" & request("txtFirstName") & "'," & "'" & request("txtLastName") & "', " & "'" & request("txtaddress") & "', " & "'" & request("txtcity") & "', "& "@Id_Req " & "OUTPUT" & chr(10)

'Formats one or more sql statements that will be passed to the
'database In this examples I use six different ways.
strsql3 ="SELECT * FROM AllData WHERE RecordId = @Id_Req" & Chr(10)
strsql4 ="SELECT AllData.fname, AllData.lname FROM Alldata WHERE RecordId = @Id_Req" & Chr(10)
strsql5 ="SELECT AllData.fname FROM AllData WHERE RecordId = @Id_Req" & Chr(10)
strsql6 ="SELECT AllData.lname FROM AllData WHERE RecordId = @Id_Req" & Chr(10)
strsql7 ="SELECT AllData.Address FROM AllData WHERE RecordId = @Id_Req" & Chr(10)
strsql8 ="SELECT AllData.city FROM AllData WHERE RecordId = @Id_Req" & Chr(10)

'Puts together all of the local variables into one variable
'That will be used by the recordset object
strsql = strsql & strsql2 & strsql3 & strsql4 & strsql5 & strsql6 & strsql7 & strsql8

'This is optional this writes out the strsql local variable
'that will be passed to the database
response.write "<b>" & "Sql Statement that is passed to the database" & "</b>" & "<br>"
response.write strsql & "<br>" & "<br>"

'sets a connection & recordset objects and executes the strsql local variable
set conn = server.createobject("adodb.connection")
conn.open strconn
set rs = server.createobject("adodb.recordset")
rs.open strsql, conn

'Parses out the individual recordsets and places them
'into individual table rows
intcount = 1
Do Until rs Is Nothing
response.write "<table border='1' width='25%'>"

response.write "<b> Contents of recordset #" & intCount & "</b><br>"
'Parses out the individual recordsets and places them into table rows
Do While Not rs.EOF
response.write "<TR>"
For Each oField In RS.Fields
response.write "<TH>" & oField.Name & "</TH>"
Next
Response.write "</TR>" & "<TR>"
For Each oField In RS.Fields
response.write "<TD ALIGN=center>"
If IsNull(oField) Then
Response.Write " "
Else
Response.Write oField.Value
End If
response.write "</TD>"
Next
rs.MoveNext
Loop
'Uses the NEXTRECORDSET Method
Set rs = rs.NextRecordset
intCount = intCount + 1
response.write "</table>"
Loop
%>

 

上下文章:

 

上一篇文章: 超长字符的智能分页-支持HTML 下一篇文章: 利用FSO取得BMP,JPG,PNG,GIF文件信息

相关文章:

  • 教你动用Ps历史画笔美化一个青春美丽动人的MM照片
  • 熊猫对于太阳井老2输出的一点思考
  • 使用搜狗音乐盒下载歌曲,快带飚的体验
  • 教你如何使用Procmail 过滤mail病毒
  • 盗号记录器通过钩子专盗网络游戏账号

相关软件:

  • 中国车牌号查询系统(ChinaCar) V1.1
  • 全国计算机等级考试模拟软件(2006年全年使用)二级Visual Basic V9.0
  • 手机版手机归属地查询 1.1
  • QQ状态查询小精灵 V4.49
  • 民事吉日查询程序 3.4
  • 环星手机短信查询系统 v 3.0

 

快速导航

  • 网络学院
  • 精品汇聚
  • 字体下载
  • 教程下载
  • ASP源码
  • PHP源码
  • Net源码
  • JSP 源码

编程技术分类导航

  • ASP & ASP.NET教程
  • PHP教程
  • JSP教程
  • C/C++教程
  • VB & VB.NET教程
  • VC教程
  • Delphi教程
  • BCB教程
  • VFP教程
  • PB教程
  • JAVA教程
  • XML教程
  • C#教程
  • CGI教程

本类经典文章推荐

  • 九阳神功 ASP.NET技术的学习顺序
  • 在ASP与ASP.NET之间共享对话状态(...
  • 17种正则表达式
  • 关闭窗口时保存数据的办法
  • 一个新的JMail(4.3版本)发送代码
  • 一个很简单的验证码程序
  • 用正则解析图片地址,并利用XMLHTT...
  • 利用ASP+JMAIL进行邮件群发的新思...
  • ASP操作Excel技术总结
  • MD5算法研究(2)

ASP & ASP.NET教程阅读排行

  • 用纯ASP代码实现图片上传
  • ASP数据库简单操作教程
  • aspjpeg组件高级使用方法介绍
  • 一个拷贝整个文件夹(包括子文件夹...
  • 利用ASP技术实现文件直接上传功能
  • 几例在ASP存储过程的使用方法
  • 一个很简单的验证码程序
  • 创建一个ASP通用分页类(一)
  • ASP操作Excel技术总结
  • 一个新的JMail(4.3版本)发送代码

编程技术阅读总排行

  • VB入门教程之一
  • Java连接数据库实例
  • 第二章 PowerBuilder 入门之创建新...
  • VC++之List Box/Check List Box控...
  • 第一章 什么是PowerBuilder
  • VC++ List Ctrl控件
  • VC++ Combo Box/Combo Box Ex控件
  • 学C++不得不看的一篇文章
  • VB入门教程之二
  • VC++之Button控件

广告位置

字母检索 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 回到顶部

关于我们 | 版权声明 | 免责条款 | 广告联系 | 软件发布 | 下载帮助 | 下载排行 | 网站地图 | 特别鸣谢 | 友情连接

copyright; 2005-2008 D9soft.com 第九软件网 版权所有