Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Response object error 'ASP 0185 : 8002000e'

Status
Not open for further replies.

theJoekr

IS-IT--Management
Jul 28, 2005
4
NL
I have a simple links database and a table with 1 record in it.
i just want to display the record but i got this error:

Response object error 'ASP 0185 : 8002000e'

Missing Default Property

/links.asp, line 0

A default property was not found for the object.

here is my code:

<%
Dim cnnEditor
Dim strDBPath
Dim rstContent

strDBPath = Server.MapPath("/db/links.mdb")

Set cnnEditor = Server.CreateObject("ADODB.Connection")
cnnEditor.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & ";"

Set rstCont = cnnEditor.Execute("SELECT * FROM links")

%>

<html>
<head>
<title> Links </title>

</head>

<body>
<%= rstCont %>

</body>
</html>
<%
rstContent.Close
Set rstContent = Nothing
cnnEditor.Close
Set cnnEditor = Nothing
%>
 
Code:
<html>
<head>
<title> Links </title>

</head>
<body>
<%
Dim cnnEditor
Dim strDBPath
Dim rstContent

strDBPath = Server.MapPath("/db/links.mdb")
Set rstCont = Server.CreateObject("ADODB.Recordset")
Set cnnEditor = Server.CreateObject("ADODB.Connection")
cnnEditor.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & ";"

rstCont.Open "SELECT * FROM links", cnnEditor

Response.Write "<table border=1>"
    If Not rstCont.EOF Then
        Response.Write "<tr>"
        For x = 0 To rstCont.Fields.Count - 1
            Response.Write "<th>" & rstCont(x).Name & "</th>"
            Response.Flush()
        Next
        Response.Write "</tr>"
        
        Do While Not rstCont.EOF
            Response.Write "<tr>"
            For x = 0 To rstCont.Fields.Count - 1
                Response.Write "<td>" & rstCont(x)& "&nbsp;</td>"
            Next
            Response.Write "</tr>"
            rstCont.MoveNext
        Loop
    End If
    Response.Write "</table>"

%>
</body>
</html>
<%
rstContent.Close
Set rstContent = Nothing
cnnEditor.Close
Set cnnEditor = Nothing
%>

-DNG
 
did not use your complete code but i did it with the changes and now i stumbled upon the next problem.

in my table i have a field called "link" it's defined as a hyperlink. and i also have a field "short" and "long"

i want the link just to be the hyperlink to the website and the text to be the short description, i did this:

<a href="<%rstContent("link")%>"><%= rstContent("short")%></a>

i have also tried it with ' but that didn't work either.
this is the error:
Microsoft VBScript runtime error '800a01c2'

Wrong number of arguments or invalid property assignment

/links.asp, line 26
 
you are missing = sign

<a href="<%[red]=[/red]rstContent("link")%>"><%= rstContent("short")%></a>

-DNG

 
ok, guess i know even less then i thought.

now offcourse i wanna loop threw my records until EOF
where do i place the statement and what should it excatly be?

<table border="1">
<tr>
<td>
<a href="<%=rstContent("link")%>">
<%= rstContent("short")%></a>
</td>
</tr>
<tr>
<td>
<%= rstContent("long")%>
</td>
</tr>
</table>
 
something like this:

Code:
<html>
<head>
<title> Links </title>

</head>
<body>
<%
Dim cnnEditor
Dim strDBPath
Dim rstContent

strDBPath = Server.MapPath("/db/links.mdb")
Set rstContent = Server.CreateObject("ADODB.Recordset")
Set cnnEditor = Server.CreateObject("ADODB.Connection")
cnnEditor.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & ";"

rstContent.Open "SELECT * FROM links", cnnEditor

if rstContent.EOF AND rstContent.BOF then
response.write "sorry, no records found"
else
do while not rstContent.EOF
%>
<table border="1">
<tr>
<td>
<a href="<%=rstContent("link")%>"><%= rstContent("short")%></a>
</td>
</tr>
<tr>
<td>
<%= rstContent("long")%>
</td>
</tr>
</table>
<%
rstContent.Movenext
loop
end if
%>
</body>
</html>
<%
rstContent.Close
Set rstContent = Nothing
cnnEditor.Close
Set cnnEditor = Nothing
%>

-DNG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top