Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 11th, 2005, 10:06 PM
Authorized User
 
Join Date: Sep 2003
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to zaeem Send a message via Yahoo to zaeem
Default MAX Query

now when I run this page it says that
• “Error Type:
ADODB.Recordset (0x800A0CC1)
Item cannot be found in the collection corresponding to the requested name or ordinal.
/address/UploadReceive.asp, line 99
actually it gives the error in sid=rs.fields(“sid”).value, I will be thankful if somebody help me out.
code is given below
Bye


<% Dim Conn, RS,DSNName,sid
Set Conn = Server.CreateObject("ADODB.Connection")
Set RS = Server.CreateObject("ADODB.Recordset")
DSNName = "DRIVER=Microsoft Access Driver (*.mdb);DBQ="
DSNName = DSNName & Server.MapPath("database/AddressBook.mdb")
Conn.Open DSNName

rs.open"select max(sid) from users",Conn,3,3
 sid=rs.fields(“sid”).value
  rs.close
%>





Zaeem Sherazi
__________________
Zaeem Sherazi
 
Old April 12th, 2005, 03:16 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Zaeem,
Your query will be returning a field called "max(sid)" or similar, try changing it to:
Code:
"select max(sid) AS sid from users;"
HTH,

Chris






Similar Threads
Thread Thread Starter Forum Replies Last Post
Selecting MAX Value nirmal_s19 SQL Server ASP 1 May 8th, 2007 01:04 AM
Max Date kristina Crystal Reports 1 July 10th, 2005 09:03 AM
Problem using query to obtain max mth hayley Classic ASP Databases 2 January 24th, 2005 10:27 PM
Query String Too Long....Max Length Error Message phungleon Classic ASP Databases 14 May 28th, 2004 12:25 PM
How to get max value within same id jackps SQL Server 2000 1 January 20th, 2004 07:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.