Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

jackkid

questbook naum esta postando!

Recommended Posts

ola galera do asp ...cansei de procuar em outros foruns e sites mas a coisa ta braba ... naum obtive resposte...intaum vou tenta aki tb....

bom eu to testando um questbook que eu baixei de um site , mas naum esta postando as mensagens...

foi feito em flash e tem um banco de dados access, e 2 arquivos asp. no servidor tem 3 pastas para carregar os arquivos :

html

data

log

O banco de dados eu coloquei na pasta DATA

os arquivos asp ta na pasta html

vou postar o codigo :

ado.asp:

 

<%

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

***

'** Copyright © 2001 Ultrashock Inc.

'** For information regarding terms of use go to http://www.ultrashock.com/legal/terms_of_use.htm

'** Jens Grau / www.retroscope.com

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

***

'** This file is provided as is.

'** If you are not familiar with ASP, Access database and SQL you should check

'** up on the microsoft homepage, where you can find helpfiles in these topics

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

***

'** NOTE!

'** Your can not run this file in your normal browser, in order for it to work

'** The files must be placed on a server, that could also be personal web server

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

***

%>

<%

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

****************

'** Return result from a SQL request in an array

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

****************

function DBretrive(strsql)

dim objrec

on error resume next

set ObjDB = server.CreateObject("ADODB.connection")

ObjDB.Open strDBname, strDBuser, strDBpwd

set ObjRec = ObjDB.Execute(strsql)

if err <> 0 then

response.write("<b>ERROR:</b><br>------------------------------------------------------<br>")'

response.write(strsql & "<br><br>")

response.write("<b>" & err.description & "</b><br>-------------------------------------------------------<br><br>")

end if

if not objRec.eof then

DBretrive = ObjRec.getrows()

end if

ObjDB.Close

objDB = null

end function

 

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

****************

'** Execute a SQL statement

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

****************

function DBexecute(strsql)

dim objrec

on error resume next

set ObjDB = server.CreateObject("ADODB.connection")

ObjDB.Open strDBname, strDBuser, strDBpwd

' set ObjRec = ObjDB.Execute(strsql)

ObjDB.Execute(strsql)

if err <> 0 then

response.write("<b>ERROR:</b><br>------------------------------------------------------<br>")

response.write(strsql & "<br><br>")

response.write("<b>" & err.description & "</b><br>-------------------------------------------------------<br><br>")

end if

ObjDB.Close

objDB = null

end function

%>

 

 

tem outro:

database.asp:

 

<%@ Language=VBScript %>

<%

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

***

'** Copyright © 2001 Ultrashock Inc.

'** For information regarding terms of use go to http://www.ultrashock.com/legal/terms_of_use.htm

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

***

'** This file is provided as is.

'** If you are not familiar with ASP, Access database and SQL you should check

'** up on the microsoft homepage, where you can find helpfiles in these topics

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

***

'** NOTE!

'** Your can not run this file in your normal browser, in order for it to work

'** The files must be placed on a server, that could also be personal web server

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

***

%>

<!-- #include file="ado.asp" -->

<%

 

Response.Expires = 0

Response.Expiresabsolute = Now() - 1

Response.AddHeader "pragma","no-cache"

Response.AddHeader "cache-control","private"

Response.CacheControl = "no-cache"

 

'** How to access the database, using a DSN-les connection

dbpath = Server.MapPath("msgboard.mdb")

strDBname = "Driver={Microsoft Access Driver (*.mdb)}; UID=admin; DBQ=" & dbpath

strDBuser = ""

strDBpwd = ""

 

'** Get the action, send from the clinet

dbaction = request("dbaction")

select case dbaction

case "postmessage"

'** insert a new message into the table

strsql = "insert into msg (poster,message) values ("

strsql = strsql & "'" & request("poster") & "',"

strsql = strsql & "'" & request("message") & "')"

dbexecute(strsql)

Response.Write("Result=ok")

case "readmessages"

'** read all the messages and return them to the client

ArrayAllMessages = dbretrive("Select id,poster,message from msg order by id desc")

if isarray(ArrayAllMessages) then

Response.Write("RecordCount=" & ubound(ArrayAllMessages,2) & "&")

for a = 0 to ubound(ArrayAllMessages,2)

Response.Write("MessageId" & a & "=" & ArrayAllMessages(0,a) & "&")

Response.Write("MessagePoster" & a & "=" & ArrayAllMessages(1,a) & "&")

Response.Write("MessageContent" & a & "=" & ArrayAllMessages(2,a) & "&")

next

Response.Write("Error=0&")

else

Response.Write("Error=1&")

end if

Response.Write("Result=ok")

case "DeleteMessage"

'** delete a message from the database

dbexecute("Delete from msg where id=" & request("messageID"))

Response.Write("Result=ok")

end select

 

%>

 

como naum sei nada de asp naum sei se esse codigo esta correto....quem poderia me ajudar ....desde ja agradeço ...vlw......

Compartilhar este post


Link para o post
Compartilhar em outros sites

ola galera do asp ...cansei de procuar em outros foruns e sites mas a coisa ta braba ... naum obtive resposte...intaum vou tenta aki tb....bom......

jackkid,ta sendo exibida alguma mensagem de erro?posta ai o que está ocorrendo, só assim fica mais fácil de te ajudar!flw

Compartilhar este post


Link para o post
Compartilhar em outros sites

ola galera do asp ...cansei de procuar em outros foruns e sites mas a coisa ta braba ... naum obtive resposte...intaum vou tenta aki tb....bom......

jackkid,ta sendo exibida alguma mensagem de erro?posta ai o que está ocorrendo, só assim fica mais fácil de te ajudar!flw
naum ta naum.......o botao enviando fica piscando..indicando que esta postando ..mas naum aparece nunca na area de post.....

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.