When using ADO to access database through Web or in normal Client/server application , we have almost all the mostly used properties/methods required for data/record manipulation and we can also move to next recordset but there is no property/method to know how many recordset are returned by query or stored proc. The following code lets you know how many recordsets are returned by a query/stored proc. :
function get_number_of_recordset (rs)
i = 0
while not rs is nothing
' insert your code here (optional only if u want to)
i = i + 1
set rs = rs.NextRecordset
wend
get_number_of_recordset = i
end function
Here you just pass an reference of an recordset as argument to get_number_of_recordset
function which then will return integer value indicating the total no. of recordset that exists as a result of the execution of query or stored procedure. The above function can be directly incorporated into your asp page with no modification , but to use the above in normal VB application the following code should be incorporated :
function get_number_of_recordset (byref rs as ADODB.Recorset) as integer
dim i as integer
i = 0
while not rs is nothing
i = i + 1
set rs = rs.NextRecordset
wend
get_number_of_recordset = i
end function
The Following example shows the utilization of the above function :
< --- recodset.asp --- >
function get_number_of_recordset (rs)
i = 0
while not rs is nothing
i = i + 1
set rs = rs.NextRecordset
wend
get_number_of_recordset = i
end function
set conn = Server.CreateObject ( "Adodb.Connection" )
set rs = server.CreateObject ( "Adodb.recordset" )
set cmd = server.CreateObject ( "Adodb.command" )
conn.open "yourdsn" rem specify your dsn
set cmd.ActiveConnection = conn
cmd.CommandText = "sp_help ""your table name"" " rem here you can write your normal rem sql stmt also instead of sp_help "your table name"
set rs = cmd.Execute ()
rem sp_help is SQL Server system stored proc. returns 7 recordsets where each recordset gives the charcteristic of your table, for eg, your table structure , primary key - foreign key , indexes , indentity field information etc.
Response.write ("The No. Of Recordsets Returned Are :" & get_number_of_recordset(rs) )
< --- recodset.asp --- >
By Modifying the function ie.(replacing insert your code line with your actuall code ) you can incorporate your functionality depending upon your task. Event though you dont replace that line still code would function well.
This issue of 15 Seconds contain an example of how to create an ISAPI server extension in MSVC 4.2 with ODBC 3.0 connection pooling. There is also an evaluation of ODBC 3.0, OLEDB, ADO and DAO. [Read This Article][Top]
Connection pooling might be the easiest way to speed up your dynamic web pages reading from SQL Server. Unfortunately, connection pooling within is turned off by default in Active Server pages. Probably because connection pooling is rarely understood in its entirety. This issue discusses connection pooling with ASP, ISAPI, IDC, and Visual Basic applications. Included is a discussion about ODBC 3.0 and the newest bug fix for ODBC. [Read This Article][Top]
In this article Amos El-Roy demonstrates how to create a file repository using ASP pages. A seamless approach that maximizes accessibility and lowers administrative overhead is illustrated in the article's example, which is available for download. [Read This Article][Top]
Bill Jeffries's article on Excel's Web Query tool demonstrates how to update selected spreadsheet cells instantly over an HTTP connection. [Read This Article][Top]
The help system presented in Vujosevic and Laberge's article is self contained and can be updated and altered without impacting the original Web application. Much like an online book, the help icon in the Web application dives into an application system for the help option. Each Web page has its own separate help page with a database that contains one row in a table for every calling Web page. Sample code is provided. [Read This Article][Top]
Selva Kumar’s article shows how to create practical Oracle database connectivity from ASP using Oracle Objects for OLE (OO4O). OO40, the Oracle middleware, allows native access to Oracle from client applications using the Microsoft Object Linking and Embedding (OLE) standard. Sample code is provided. [Read This Article][Top]
Cindy Cruciger claims there is a better way to write a functional Active Server Page that allows interaction between a database file and the Web, without getting caught in an SQL nightmare. She offers a snippet of SQL code and adds some logical layers, error checking and formatting. [Read This Article][Top]
Developer Stephan Onisick shows us how to create a standalone/custom recordset and use its organizational ability to perform logical tasks with data without connecting to a database. This article uses a small application written using VBScript, ADO 2.1, and an Excel spreadsheet to record and print computer expenses for tax preparations. The standalone recordset is saved in XML format, and the file can be updated with new data simply by reopening as a recordset and using normal recordset methods. [Read This Article][Top]
Storing frequently used lookup data in a database is a great idea (e.g. order status codes, state names, etc.) that saves tremendous amounts of time in design and maintenance. However, retrieving that data from the database every time it is needed is very inefficient. This article describes how to use Application variables to cache frequently used lookup data in memory to achieve lightning fast access times. In my tests, I've seen as much as a 5000% increase in performance. [Read This Article][Top]
Many offices, particularly in military and government organizations, are required to have someone in charge during office hours. If the official manager is absent, that person delegates responsibility to someone else as acting, but who?
A Key Personnel Today table shows who is acting in every official position and how to reach them.
The FileSystemObject group is a set of COM objects that allow you to
manipulate the file system on from an Active Server Page.
FileSystemObject which is documented here is the version that comes with
IIS 4.0. Which is much different then the limited version which shipped
with IIS 3.0. The set of COM objects which consist of the
FileSystemObject software are all free and cover almost every feature
needed.