When you add a new record, several factors determine where it will be inserted. If you need to come back to this record later, save a bookmark to the current row. However, when you insert records into a table without an index against Microsoft SQL Server, you will not be able to get back to the newly inserted row after you move the current record pointer unless a Requery is performed.
However, if you are using SQL Server and one column has a IDENTITY value you can execute the below script to get the IDENTITY of the row, if the column is also a primary key then you can use the returned value to access the row again.
'A little code to Give Out the Right Cookie
UserId=Request.Cookies("USER")
' If there isn't a cookie then Get One From the SQL Server
if UserId = "" then
Set connOnline = Server.CreateObject("ADODB.Connection")
connOnline.Open "UserDatabase", "login", "password"
sql="INSERT INTO tblUser DEFAULT VALUES SELECT @@IDENTITY 'UserId'"
Set RS = connOnline.Execute(sql)
NextRS=RS.NextRecordset
UserId=NextRS("UserId")
connOnline.Close
' Set Cookie
Response.Cookies("USER")=UserId
end if
Here is the SQL to create the Table in the UserDatabase
CREATE TABLE tblUser (UserId int IDENTITY NOT NULL PRIMARY KEY)
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.