Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
<% dim filename 'name of database file dim maxfld 'record counter dim cmtStr ' comment string filename="D:\Inetpub\clientes\meuserver.com.br\Data\guestbook" cs="Provider=Microsoft.jet.oledb.3.51;" cs=cs & "Persist Security info=false;" cs=cs & "data source=" cs=cs & filename & ";" set adocon=server.createobject("adodb.connection") adocon.open cs txtname=request.form.item("txtname") txtemail=request.form.item("txtemail") txtwebsite=request.form.item("txtwebsite") txtcomments=request.form.item("txtcomments") set rs_max_value=adocon.execute("select max(val(gid)) as x from tbguest") maxfld=rs_max_value.fields("x") if isnull(maxfld) then maxfld=1 else maxfld=maxfld+1 end if rs_max_value.closeif request.form.item("submit1")="Y" then cmtstr = "Name: <b>" & txtname & "</b><br>Email: <b><u><a href=" & "'" & "mailto:" & txtemail & "'" & ">" & txtemail & "</a></u></b><br>" cmtstr = cmtstr & "Website: <b><u><a href=" & "'" & txtwebsite & "'" & " target=" & "'" & "_blank" & "'" & ">" & txtwebsite & "</a></u></b><br>" cmtstr = cmtstr & "Comments: <b>" & txtcomments & "</b><br>" cmtstr = cmtstr & "<i>Posted on: " & Now() & "<br>" dim commandobject dim insertionstr set commandobject=server.createobject("adodb.command") set commandobject.activeconnection=adocon insertionstr="insert into tbguest (gid,gcomments) values (?,?)" commandobject.commandtext=insertionstr commandobject.prepared=true commandobject.parameters.append commandobject.createparameter("gid",3,,1000) commandobject.parameters.append commandobject.createparameter("gcomments",200,,500) commandobject("gid")=maxfld commandobject("gcomments")=cmtstr commandobject.execute set commandobject=nothingend if dim llimit dim hlimit llimit=request.form.item("lowlimit") hlimit=request.form.item("highlimit") dim sqlstr dim flashstr sqlstr="select max(gid) as x from tbguest" set rs_flash=adocon.execute(sqlstr) totalent=rs_flash.fields("x") rs_flash.close if totalent>0 then sqlstr="select * from tbguest order by gid desc" set rs_flash=adocon.execute(sqlstr) dim strflash rs_flash.movefirst if totalent>=hlimit then hlimit=totalent end if upto=llimit-1 j=0 for j=1 to upto rs_flash.movenext next i=0 for i=1 to (hlimit-llimit)+1 if rs_flash.eof then exit for strflash=strflash & rs_flash.fields("gcomments") rs_flash.movenext next strflash=strflash & "<br><br>" & " Nada abaixo desta mensagem "else strflash="Não há mensagens" rs_flash.close end if response.write("&txtll=" & llimit & "&txthl=" & hlimit & "&totalentries=" & totalent & "&txtmain=" ) response.write(strflash)adocon.close%>
Esse código de cima me liga o flash ao bd. Mas, quando coloco pr rolar, seja on-line ou local, no campo onde deveria me retornar a mensagem aparece só:
" ) response.write(strflash)adocon.close
Me parece, pela resposta do flash que tem alguma aspa a mais ou a menos ai...ou um "&"..sei lá. Infelizmente não capisco nhente de asp.
Podem me dar uma mão?
Este é o retorno da listagem de variáveis do flash:
"\"N�h�ensagens\"\r\n rs_flash.close\t\r\nend if\r\n response.write(\""
Grato
Carregando comentários...