• 0
Sign in to follow this  
Guest Daniduk

Livro Visitas Asp

Question

Guest Daniduk

ADODB.Recordset error '800a0bb9'

Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

/default.asp, line 43

Isto é o que aparece quando se é inserido alguma mensagem em meu livro de visitas.

Já procurei saber de outros erros parecidos, mas não vi nenhum com o erro da linha 43, essa é a primeira vez que tento colocar um livro em ASP, mas não tenho a mínima idéia de como ministrar.

Peço uma ajuda, agradeço.

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0
Guest Daniduk

Olha, na verdade nem sei que código você está pedindo, seria o código fonte?

Nem sei onde encontrar essa linha 43...

Share this post


Link to post
Share on other sites
  • 0
Guest Daniduk

Consegui resolver essa linha 43, depois apareceu uma outra 45. (já descobri onde se vê os números de linha...)

depois de as mensagens serem postadas, os erros de linha já não aparecem mais, porém as mensagens não aparecem, mas não alegam mais erros de linhas.

Apenas que não há mensagens no momento, então assine o livro, mas mesmo assinando as mensagens não aparecem.

Como faço para resolver esse problema?

http://www.daniellakai.com

LivroAdLibitum

Share this post


Link to post
Share on other sites
  • 0
Guest Assinar

<html>

<head>

<title>DANIELLA KAI 1980~ADLIBITUM</title>

<!-- scripting , html copyright 1998 Kathi O'Shea ------->

<!-- email [email protected] for custom web development --->

<!-- see readme.txt in zip file for modification and ---->

<!-- redistribution info -------------------------------->

</head>

<body bgcolor="black" text="#C5BE60" topmargin=0 leftmargin=0 style="font-family: Comic Sans MS; font-size: 10 pt">

<center>

<%

Flag = request.form("Flag")

If IsEmpty(Flag) or Flag = "" then

%>

<font face="Times New Roman">

<i><h1><img border="0" src="images/livro.visitas.gif"></h1><h1><font color="#800000">Ad Libitum</h1></font></i>

</font>

<font size=3>

* Campos Obrigatórios</font><p>&nbsp;

<table width=500 border=0>

<tr>

<td width=100 align="right">

<font size=2>

<b>*Nome:</b>

</font>

</td>

<td width=400>

<form action="sign.asp" method="POST">

<input type="text" name="Name" size=30 style="font-family: Comic Sans MS; font-size: 10 pt"><font size="2">

</font>

</td>

</tr>

<tr>

<td width=100 align="right">

<font size=2>

<b>*Estado:</b>

</font>

</td>

<td width=400><input type="text" name="City" size=30></td>

</tr>

<tr>

<td width=100 align="right">

<font size=2>

<b>&nbsp;Cidade:</b>

</font>

</td>

<td width=400><input type="text" name="State" size=30></td>

</tr>

<tr>

<td width=100 align="right">

<font size=2>

<b>*País:</b>

</font>

</td>

<td width=400><input type="text" name="Country" size=30></td>

</tr>

<tr>

<td width=100 align="right">

<font size=2>

<b>&nbsp;Email:</b>

</font>

</td>

<td width=400><input type="text" name="Email" size=30></td>

</tr>

<tr>

<td width=100 align="right">

<font size=2>

<b>&nbsp;URL:</b>

</font>

</td>

<td width=400><input type="text" size=30 name="URL" value="http://"></td>'>http://"></td>

</tr>

<tr>

<td valign="top" width=100 align="right">

<font size=2>

<b>Comentário:</b>

</font>

</td>

<td width=400>

<font color="#E4E4E4">

<textarea name="Comments" cols=30 rows=5 wrap="virtual"></textarea></font><font size="2"> </font>

</td>

</tr>

<tr>

<td width=100>&nbsp;</td>

<td width=400><br>

<input type="submit" value="Enviar" style="font-family: Comic Sans MS; font-size: 10 pt; color: #E4E4E4; background-color: #000000">

<input type="hidden" name="Flag" value=1>

&nbsp;<input type="reset" value="Limpar" style="font-family: Comic Sans MS; font-size: 10 pt; color: #E4E4E4; background-color: #000000"></form>

</td>

</tr>

</table>

<%

End If

If Flag = 1 then

If IsEmpty(request.form("Name")) or request.form("Name")="" then

response.write "<center><font face='arial' size=4>"

response.write "<p><br><b>Você precisa inserir seu nome.</b></font>"

response.write "<form>"

response.write "<input type='button' value='Retry' onclick=history.back()>"

response.write "</form>"

response.end

Else

Name = request.form("Name")

End If

If IsEmpty(request.form("City")) or request.form("City")="" then

response.write "<center><font face='arial' size=4>"

response.write "<p><br><b>Você precisa inserir seu Estado.</b></font>"

response.write "<form>"

response.write "<input type='button' value='Retry' onclick=history.back()>"

response.write "</form>"

response.end

Else

City = request.form("City")

End If

' we won't require a state

State = request.form("State")

If IsEmpty(request.form("Country")) or request.form("Country")="" then

response.write "<center><font face='arial' size=4>"

response.write "<p><br><b>Você precisa inserir seu país.</b>"

response.write "</font><form>"

response.write "<input type='button' value='Retry' onclick=history.go(-1)>"

response.write "</form>"

response.end

Else

Country = request.form("Country")

End If

Email = request.form("Email")

If request.form("URL")="http://" then

URL = ""

Else

URL = request.form("URL")

End If

If IsEmpty(request.form("Comments")) or request.form("Comments")="" or request.form("Comments")=" " then

response.write "<center><font face='arial' size=4>"

response.write "<p><br><b>Não esqueça de deixar um comentário!</b>"

response.write "</font><form>"

response.write "<input type='button' value='Retry' onclick=history.go(-1)>"

response.write "</form></center>"

response.end

Else

Comments = request.form("Comments")

Comments = Replace(Comments, Chr(34), "''")

Comments = Replace(Comments, vbCrLf, "<br>")

End If

Flag = request.form("Flag")

%>

<table width=400 border=0>

<tr>

<td width=400 style="font-family: Comic Sans MS; font-size: 10 pt; color: #C5BE60">

<font face="arial" size=2>

<br></font>

<b>

<font size=2 color="#E4E4E4">

Aqui estão as informações inseridas que irão aparecer no Livro

AdLibitum.</font></b><font face="Comic Sans MS" size=2><br>

<br></font>

<font size=2>

<font color="#FFFFFF">Nome:</font> <%= Name %>

<br><font color="#FFFFFF">Estado:</font> <%= City %>

<br><font color="#FFFFFF">Cidade:</font> <%= State %>

<br><font color="#FFFFFF">Email:</font> <%= Email %>

<br><font color="#FFFFFF">URL: </font> <%= URL %>

</font>

<font face="Comic Sans MS" size=2>

<font size=2>

<p><font color="#FFFFFF">Comentário: </font> <%= Comments %>

</font>

<form action="sign.asp" method="post">

<input type="hidden" name="Name" value="<%= Name %>">

<input type="hidden" name="City" value="<%= City %>">

<input type="hidden" name="State" value="<%= State %>">

<input type="hidden" name="Country" value="<%= Country %>">

<input type="hidden" name="Email" value="<%= Email %>">

<input type="hidden" name="URL" value="<%= URL %>">

<input type="hidden" name="Comments" value="<%= Comments %>">

<input type="hidden" name="Flag" value=2>

<p align="center">

<input type="submit" value="Enviar!" style="font-family: Comic Sans MS; font-size: 10 pt; color: #E4E4E4; background-color: #000000">&nbsp;

<input type="button" value="Refazer" onClick="history.go(-1)" style="font-family: Comic Sans MS; font-size: 10 pt; color: #E4E4E4; background-color: #000000">

</p>

</form></font>

</td>

</tr>

</table>

<%

End If

If Flag = 2 then

Today = Now()

Name = request.form("Name")

Name = Replace(Name, "'", "''")

Name = Replace(Name, Chr(34), "''")

City = request.form("City")

City = Replace(City, "'", "''")

State = request.form("State")

Country = request.form("Country")

Country = Replace(Country, "'", "''")

Email = request.form("Email")

URL = request.form("URL")

Comments = request.form("Comments")

Comments = Replace(Comments, "'", "''")

' ok now we've got our data so let's ship it off to the database

set conn = server.createobject("adodb.connection")

' **** change DSN name if you're using a DSN and you've named it differently

'conn.open "guestbook"

' **** DSN-less connection: comment out above line and uncomment the

' **** Code between "Begin" and "End"

' **** BEGIN DSN-LESS CONNECTION CODE

DSNtemp="DRIVER={Microsoft Access Driver (*.mdb)}; "

DSNtemp=dsntemp & "DBQ=" & server.mappath("/guestbook.mdb")

conn.Open DSNtemp

' **** END OF DSN-LESS CONNECTION CODE

' **** Note: If using a DSN-less connection, make sure to change server.mappath above to

' **** reflect the actual location of the guestbook database file.

' **** The above will work if the database file is at the webserver root.

' **** See readme.txt for further information

' **** the following line would be used ONLY if you use a system DSN!

' conn.Open "guestbook"

SQLstmt = "INSERT INTO Guestbook (Name,City,State,Country,Email,URL,Comments)"

SQLstmt = SQLstmt & " VALUES ("

SQLstmt = SQLstmt & "'" & Name & "',"

SQLstmt = SQLstmt & "'" & City & "',"

SQLstmt = SQLstmt & "'" & State & "',"

SQLstmt = SQLstmt & "'" & Country & "',"

SQLstmt = SQLstmt & "'" & Email & "',"

SQLstmt = SQLstmt & "'" & URL & "',"

SQLstmt = SQLstmt & "'" & Comments & "'"

SQLstmt = SQLstmt & ")"

Set RS = conn.execute(SQLstmt)

If err.number>0 then

response.write "VBScript Errors Occured:" & "<P>"

response.write "Error Number=" & err.number & "<P>"

response.write "Error Descr.=" & err.description & "<P>"

response.write "Help Context=" & err.helpcontext & "<P>"

response.write "Help Path=" & err.helppath & "<P>"

response.write "Native Error=" & err.nativeerror & "<P>"

response.write "Source=" & err.source & "<P>"

response.write "SQLState=" & err.sqlstate & "<P>"

end if

IF conn.errors.count> 0 then

response.write "Database Errors Occured" & "<P>"

response.write SQLstmt & "<P>"

for counter= 0 to conn.errors.count

response.write "Error #" & conn.errors(counter).number & "<P>"

response.write "Error desc. -> " & conn.errors(counter).description & "<P>"

next

else

response.write "<br><br><font face='Times New Roman' size=4><b>"

response.write "Sua mensagem foi enviada com sucesso!.</font><p>"

response.write "<font face='arial' size=2>"

response.write "<a href='default.asp'>Ler Livro</a>"

end if

Conn.Close

Set conn = nothing

' *****************************************************************

' The following section of code sends email to the guestbook owner

' when somebody signs the guestbook. If you don't want this feature,

' just remove this block. Please note that this will ONLY work on

' NT SERVER with built-in SMTP!! On other systems, please see

' http://www.attitude.com/users/kathi/asp/tools.html for a list of

' components, including email components

' ******************************************************************

Set Mail = CreateObject("CDONTS.Newmail")

' get the sender's address, and if empty, put your own

If request("email")="" then

Sender = "[email protected]" ' put your email address here

Else

Sender = request("email")

End If

Mail.From = Sender

Mail.To = "[email protected]" ' put YOUR email address here

Mail.Subject = "Assinaram o Livro AdLibitum" ' you can change this to whatever you'd like

Msg = "Name: " & request("name") & Chr(10)

Msg = Msg & "City: " & request("city") & Chr(10)

Msg = Msg & "State: " & request("State") & Chr(10)

Msg = Msg & "Country: " & request("Country") & Chr(10)

Msg = Msg & "URL: " & URL & Chr(10)

Msg = Msg & "Comments:" & Chr(10)

Msg = Msg & request("Comments")

Mail.Body = Msg

Mail.Send

Set Mail = Nothing

End If

%>

</center>

</body>

</html>

Share this post


Link to post
Share on other sites
  • 0
Guest Ler

<html>

<head>

<title>DANIELLA KAI 1980~LIVRO ADLIBITUM</title>

<meta http-equiv="expires" content="0">

<style>

<!--

a:link, a:visited {color:#C5BE60; font-weight:bold;}

a:active {color=yellow; background: firebrick; font-size: 100%; font-weight:bold;}

a:hover {color:yellow; font-weight:bold;}

//-->

</style>

<!-- scripting , html copyright 1998 Kathi O'Shea ------->

<!-- email [email protected] for custom web development --->

<!-- see readme.txt in zip file for modification and ---->

<!-- redistribution info -------------------------------->

</head>

<body bgcolor="black" text="#C5BE60" topmargin=0 leftmargin=0>

<center>

<h1><img border="0" src="images/livro.visitas.gif"></h1>

<h1><font size="5" face="Times New Roman">

<span style="font-weight: 400; font-style: italic">Livro AdLibitum</span></font></h1>

<font face="Comic Sans MS">

<p><font size="2">&nbsp;

<% PageNo = request("page")

If PageNo="" then

%> <a target="I3" href="sign.asp"><span style="font-weight: 400">Assinar Livro

AdLibitum</span></a></font></font><font face="arial" size=3><p>

<%

End If

set conn = server.createobject("adodb.connection")

DSNtemp="DRIVER={Microsoft Access Driver (*.mdb)}; "

' set the actual path to the guestbook below - this example

' assumes that the guestbook is in the web server root

DSNtemp=dsntemp & "DBQ=" & server.mappath("/guestbook.mdb")

conn.Open DSNtemp

sqlstmt = "SELECT * from Guestbook ORDER BY PostDate DESC"

Set rs = Server.CreateObject("ADODB.Recordset")

rs.Open sqlstmt, conn, 3, 3

TotalRecs = rs.recordcount

rs.Pagesize= 10

TotalPages = cInt(rs.pagecount)

rs.absolutepage= 10

If PageNo = 1 then

response.write "<br><Font face='arial' size=2>There are " & TotalRecs & " entries in " & TotalPages & " pages</font>"

End If

If rs.eof then

response.write "<p><br><center><font face='Times New Roman'><b>N&atilde;o h&aacute; entradas no Livro.</b>"

response.write "<br><a href='sign.asp'>Assine o Livro AdLibitum</a></font></center>"

response.end

End If

x = 0

For x = 1 to 10

If rs.eof then

Exit For

Else

When = rs("PostDate")

Name = rs("Name")

Name = Replace(Name,"''","'")

City = rs("City")

State = rs("State")

Country = rs("Country")

Email = rs("Email")

URL = rs("URL")

If IsEmpty(URL) or URL = "" then

Link = "no URL given"

Else

Link = "<a href='" & URL & "'>" & URL & "</a>"

End If

Comments = rs("Comments")

Comments = replace(Comments, "''", "'")

Start = rs("PostDate")

%>

<table width=600 border=0 cellpadding=0 cellspacing=0>

<tr><td colspan=3><font face="arial" size=2><%= When %></td></tr>

<tr>

<td colspan=3 bgcolor="#C5BE60"><font face="arial" size=2 color="#000000">

<b><%= Comments %></b></font>

</td>

</tr>

<tr>

<td width=125 valign="top">

<font face="arial" size=1>

<%

If IsEmpty(Email) or Email="" then

response.write(Name)

Else

response.write "<a href='mailto:" & Email & "'>" & Name & "</a>"

End If

%>

</font>

</td>

<td width=200 valign="top"><font face="arial" size=1><i><%= City %>&nbsp;

<%= State %>&nbsp;<%= Country %></i>

</td>

<td width=275 align="right" valign="top">

<font face="arial" size=1><%= Link %>

</font>

</td>

</tr>

</table>

<br>

<%

rs.MoveNext

End If

Next

response.write "<table width=300 border=0><tr>"

response.write "<td align='center'>"

If PageNo > 1 then

response.write "<form method='post' action='default.asp'>"

response.write "<input type='hidden' name='Page' value='" & PageNo-1 & "'>"

response.write "<font face='arial' size=2>"

response.write "<input type='submit' value='<< Prev'></form>"

Else

response.write "&nbsp;"

End If

response.write "</td><td align='center'>"

If NOT rs.eof then

response.write "<form method='post' action='default.asp'>"

response.write "<input type='hidden' name='Page' value='" & PageNo+1 & "'>"

response.write "<font face='arial' size=2>"

response.write "<input type='submit' value='Next >>'></form>"

Else

response.write "&nbsp;"

End If

response.write "</td></tr></table>"

conn.close

set conn = nothing

%>

</center>

</body>

</html>

Share this post


Link to post
Share on other sites
  • 0
Guest Administração

As mensagens (sign.asp) caem na administração do livro numa outra página, onde posso apenas deletá-las, até aí tudo bem, mas elas não aparecem no "Ler" (defaulto.asp)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this