Jump to content
Fórum Script Brasil
  • 0

Sistema De Noticias Com Erro


lampiao_muléstia
 Share

Question

eae galera....

tenho um site aqui que tem um sistema de noticias, e recentemente o mudei de servidor, porem depois que mudei de servidor, começou a dar o seguinte erro quando se tenta adicionar uma noticias pelo sistema....,

INSERT INTO tblBulletin (fldReplyID, fldGroupID, fldCateID, fldName, fldEmail, fldTitle, fldMessage, fldSendEmail, fldFace, fldDate, fldTime, fldIP) VALUES (-1,-1,1,'teste','[email protected]','teste','teste',0,-1,'10/27/2006','6:15:20 AM','201.11.189.38') 
Microsoft OLE DB Provider for ODBC Drivers error '80004005' 

[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query. 

/noticias/tools.asp, line 57 
pois bem, na linha 57 do arquivo tools.asp tem o seguinte código...vejam o que antecede o código...
42 -sql = "INSERT INTO tblBulletin (fldReplyID, fldGroupID, fldCateID, fldName, fldEmail, fldTitle, 
               fldMessage, fldSendEmail, fldFace, fldDate, fldTime, fldIP) VALUES ("
43-      sql = sql & intRID & ","
44 -      sql = sql & intGID & ","
45 -      sql = sql & intCate & ",'"
46 -     sql = sql & InsertAP(request("Name")) & "','"
47 -     sql = sql & InsertAP(request("Email")) & "','"
48 -     sql = sql & InsertAP(request("Title")) & "','"
49     sql = sql & InsertAP(request("Message")) & "',"
50-      sql = sql & intSendEmail & ","
51-      sql = sql & intFace & ",'"
52-    sql = sql & Date & "','"
53-     sql = sql & Time & "','"
54-     sql = sql & request.ServerVariables("REMOTE_ADDR") & "')"
55-     response.write SQL
56-     OpenDB con
57-     con.Execute (sql)

Valeu, galera, alguém ai sabe porque está dando esse erro???

Valeuuuuuuuuu, to precisando meso disso ai...

ATÉ +

falouuuu

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

não tem essa opção aqui cara....

seguinte, segue abaixo o código do arquivo, conexão.asp,

<%
Sub OpenDB (ByRef con)
    strPhysicalPath = Server.Mappath(".")
    strDBName = "noticias/noticias.mdb"
    Set con = Server.CreateObject("ADODB.Connection")
    con.Open "DRIVER=Driver do Microsoft Access (*.mdb);UID=admin;UserCommitSync=Yes;Threads=3;SafeTransactions=0;PageTimeout=5;MaxScanRows=8;MaxBufferSize=2048;FIL=MS Access;DriverId=25;DefaultDir=" & strPhysicalPath & ";DBQ=" & strPhysicalPath & "\" & strDBName
End Sub

Function InsertAP(t)
    If Not IsNull(t) Then
        InsertAP = Replace(t, "'", "''")
    Else
        InsertAP = ""
    End If
End Function

Sub InsertBBMessage(intRID)
     If Request("SendEmail") = "Yes" Then
         intSendEmail = 1
     Else
         intSendEmail = 0
     End If
    
     If Request("GID") = "" Then
         intGID = -1
     Else
         intGID = Request("GID")
     End If
     
     If Request("BulletinCate") = "" Then
         intCate = -1
     Else
         intCate = Request("BulletinCate")
     End If
     
     If Request("Face") = "" Then
         intFace = "-1"
     Else
         intFace = Request("Face")
     End If
     
    sql = "INSERT INTO tblBulletin (fldReplyID, fldGroupID, fldCateID, fldName, fldEmail, fldTitle, fldMessage, fldSendEmail, fldFace, fldDate, fldTime, fldIP) VALUES ("
     sql = sql & intRID & ","
     sql = sql & intGID & ","
     sql = sql & intCate & ",'"
    sql = sql & InsertAP(request("Name")) & "','"
    sql = sql & InsertAP(request("Email")) & "','"
    sql = sql & InsertAP(request("Title")) & "','"
    sql = sql & InsertAP(request("Message")) & "',"
     sql = sql & intSendEmail & ","
     sql = sql & intFace & ",'"
    sql = sql & Date & "','"
    sql = sql & Time & "','"
    sql = sql & request.ServerVariables("REMOTE_ADDR") & "')"
    response.write SQL
    OpenDB con
    con.Execute (sql)
     
     If Request("GID") = "" Then
     'yes, newly posted message
     Application.Lock
         'for SQL server, better ways can be used
         SQL = "SELECT Max(fldAuto) FROM tblBulletin"
        Set RSMax = con.Execute(SQL)
        intGID = RSMax(0)
        RSMax.Close
        Set RSMax = Nothing
        SQL = "UPDATE tblBulletin SET fldGroupID = " & intGID & " WHERE fldAuto = " & intGID
        con.Execute(SQL)
     Application.UnLock
     End If
     
    'con.Close
    'Set con = Nothing
    response.Cookies("UASP").Expires = #1/1/2005#
    response.Cookies("UASP")("ClientName") = request("Name")
    response.Cookies("UASP")("ClientEmail") = request("Email")
End Sub


Function BulletinCate(it)
    OpenDB bcCON
    s = "<SELECT NAME=BulletinCate>"
    SQL = "SELECT fldAuto, fldCategory FROM tblCategory WHERE fldActive = 1"
    Set bcRS = bcCON.Execute(SQL)
    While Not bcRS.EOF
        s = s & "<OPTION VALUE=""" & bcRS(0) & """"
        If Cstr(it) = cstr(bcRS(0)) then
            s = s & " selected"
        End If
        s = s & ">" & bcRS(1) & " (" & GetTodayNew(bcCON, bcRS(0)) & " Novas Hoje)"
    bcRS.MoveNext
    Wend
    s = s & "</SELECT>"
    BulletinCate = s
    bcRS.close
    bcCON.close
    Set bcRS = Nothing
    Set bcCON = Nothing
End Function

Function GetBulletinCate(id)
    arrCate = Array("ASP/VBScript", "HTML/Javascript","ADO/Database","XML","IIS/PWS/NT","ActiveX/COM+","Other")
    GetBulletinCate = arrCate(INT(id) - 1)
End Function

Function GetTodayNew(con, intCateID)
    SQL = "SELECT COUNT(fldAuto) FROM tblBulletin WHERE fldCateID = " & intCateID & " AND fldDate = #" & Date & "#"
    Set gtw = con.Execute(SQL)
    GetTodayNew = gtw(0)
    gtw.close
    Set gtw = Nothing
End Function

Function RadioFace
    For i = 0 to 9
        f = f & "<input type=""radio"" name=""face"" value=""" & i & """><img src=""images/face/" & i & ".gif"">&nbsp;"
        If i = 4 then f = f & "<BR>"
    Next
    RadioFace = f
End Function


Sub SendNotificationEmail(GID)
    '========================================================================
    'uncomment the following lines after you install ASPMail ActiveX Component
    'and change the email server, address to you own
    '========================================================================
    'Set mail = Server.CreateObject("APSMAIL")
    'mail.FromAddress = "[email protected]"
   'mail.FromName = "UltimateASP Bulletin Board"

    'sql = "SELECT DISTINCT fldEmail, fldName FROM tblBulletin WHERE fldGroupID = " & GID & " AND fldSendEmail = 1"
    'OpenDB SNECon
    'Set SNERs = SNECon.Execute(SQL)
    'While Not SNERs.EOF
           'mail.AddRecipient SNERs("fldName"), SNERs("fldEmail")
    'SNERs.MoveNext
    'Wend
    'SNERs.Close
    'SNECon.Close
    'Set SNERs = Nothing
    'Set SNECon = Nothing
    'mail.Subject = "Your Message Has Been Replied on UltimateASP Bulletin Board!"
    'b = b & "Per your request, this is to notify you that a reply message has been posted on UltimateASP bulletin board in your message thread. Please go to http://www.ultimateasp.com/bulletin to view it. Thank you!" & vbCrLf & vbCrLf
    'b = b & "[email protected]"
   'mail.BodyText = b
   'mail.RemoteHost = "smtp.busqui.com.br"
   'mail.SendMail
    'Set Mail = Nothing
End Sub
%>
tava conversando com um rapaz, aqui e ele me sugeriu que trocasse a conexão com o banco de dados para
 
Conexao = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("SUBDIRETORIO/ARQUIVO.mdb")
 
Ou
Conexao = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\domains\SEUDOMINIO \SUBDIRETORIO\ARQUIVO.mdb"
 

mas onde que faço essa alteração,??, sei que to sendo insistente e contra as regras do forum, mas o ponto é que eu num sei nem pra onde que vai o tal do ASP....se puderem me ajudar..., valeu

Link to comment
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.

 Share



  • Forum Statistics

    • Total Topics
      150.9k
    • Total Posts
      648.8k
×
×
  • Create New...