getting an error when running my asp script

G

Guest

Hello, I have a database called "resumes" there is a table called "saved" When I run my asp page I get the following error

Error Type:
ADODB.Recordset (0x800A0CC1)
Item cannot be found in the collection corresponding to the requested name or ordinal.
/mberry25260/myresume.asp, line 32

--- The script on my page looks like the following --------
<%
Dim strName
strName = Trim(Request.Form("Resumelogin"))
%>
<%
strconn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\inetpub\wwwroot\mberry25260\fpdb\resumes.mdb"
set conn = Server.CreateObject("ADODB.Connection")
conn.open strconn
set rs = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT saved.Name FROM saved WHERE saved.Name ='" & strName & "'"
rs.Open strSQL, strconn
%>
 
T

Thomas A. Rowe

Name is a reserved word, change it to FullName, etc.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
G

Guest

I renamed all the "Name" to "LoginName" and left the strName the way it was and I am still getting the exact same error as before. any more suggestions. Thanks Bill
 
T

Thomas A. Rowe

That good that you have rename the field, but I now see the actual problem, sorry about missing it
the first time:

This is your old query, where the only field you are requesting is "Name"
strSQL = "SELECT saved.Name FROM saved WHERE saved.Name ='" & strName & "'"

However on your page you are trying to display the content of "Address", however you haven't request
the content of the field "Address", just "Name".

So you either need to specific each field in the Select or use * to request all field in the record
that match name.

Suggest that you do not use a actual name of a person or place, etc. as a lookup value, instead
using a number, which can be a text field


--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================


Bill said:
I renamed all the "Name" to "LoginName" and left the strName the way it was and I am still getting
the exact same error as before. any more suggestions. Thanks Bill
 
G

Guest

Thanks for the help Thomas

Thomas A. Rowe said:
That good that you have rename the field, but I now see the actual problem, sorry about missing it
the first time:

This is your old query, where the only field you are requesting is "Name"
strSQL = "SELECT saved.Name FROM saved WHERE saved.Name ='" & strName & "'"

However on your page you are trying to display the content of "Address", however you haven't request
the content of the field "Address", just "Name".

So you either need to specific each field in the Select or use * to request all field in the record
that match name.

Suggest that you do not use a actual name of a person or place, etc. as a lookup value, instead
using a number, which can be a text field


--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================



the exact same error as before. any more suggestions. Thanks Bill
 
T

Thomas A. Rowe

Bill,

Did my solution solve the problem?

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
G

Guest

ya thomas it worked great
thanks

Thomas A. Rowe said:
Bill,

Did my solution solve the problem?

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
T

Thomas A. Rowe

Ok, great!!

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top