.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> VBScript >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Print Recordset result from DB using VBScript

Posted By:Athira Sreejith       Posted Date: February 23, 2009    Points: 10    Category: VBScript    URL: http://www.dotnetspark.com  
 

hI..

 

<%
Function PrintRecordSet(bPrint_ServerVariables,bPrint_FormElem,ObjRS,strObj)
dim i
If LCase(bPrint_ServerVariables) = "yes" Then
 Response.Write "

"
 Response.Write ""
 For Each item IN Request.ServerVariables
 Response.Write ""
 Next
 Response.Write "
NameValue
"&item&""&Request.ServerVariables(item)&"
"
End If
If LCase(bPrint_FormElem) = "yes" Then
 Response.Write "
URL = " & Request.ServerVariables("HTTP_REFERER") & ""
 Response.Write "
"
 Response.Write ""
 For Each item IN Request.Form
 Response.Write ""
 Next
 Response.Write "
NameValue
"&item&""&Request.Form(item)&"
"
End If
 Response.Write "
RecordSet for " &  strObj & ""
 Response.Write ""
 For i = 0 TO ObjRS.fields.count-1
 Response.Write ""
 Next
 If NOT ObjRS.BOF Then ObjRS.moveFirst
 While NOT ObjRS.EOF
  Response.Write ("")
  For i=0 TO ObjRS.fields.count-1
  Response.Write ""
  Next
  Response.Write ("")
 ObjRS.movenext
 Wend
 Response.Write("
"&ObjRS(i).name&"
"&ObjRS(i).value&"
")
 Response.Write "Total Records = " & ObjRS.recordcount & "
"
 If NOT ObjRS.BOF Then ObjRS.MoveFirst()
End Function
%><% Function PrintRecordSet(bPrint_ServerVariables,bPrint_FormElem,ObjRS,strObj) dim i If LCase(bPrint_ServerVariables) = "yes" Then Response.Write "
" Response.Write "" For Each item IN Request.ServerVariables Response.Write "" Next Response.Write "
NameValue
"&item&""&Request.ServerVariables(item)&"
" End If If LCase(bPrint_FormElem) = "yes" Then Response.Write "
URL = " & Request.ServerVariables("HTTP_REFERER") & "" Response.Write "
" Response.Write "" For Each item IN Request.Form Response.Write "" Next Response.Write "
NameValue
"&item&""&Request.Form(item)&"
" End If Response.Write "
RecordSet for " & strObj & "" Response.Write "" For i = 0 TO ObjRS.fields.count-1 Response.Write "" Next If NOT ObjRS.BOF Then ObjRS.moveFirst While NOT ObjRS.EOF Response.Write ("") For i=0 TO ObjRS.fields.count-1 Response.Write "" Next Response.Write ("") ObjRS.movenext Wend Response.Write("
"&ObjRS(i).name&"
"&ObjRS(i).value&"
") Response.Write "Total Records = " & ObjRS.recordcount & "
" If NOT ObjRS.BOF Then ObjRS.MoveFirst() End Function %>


     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend