Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Database permission problems

    Hello there guys.

    I have a problem with my update statement onto the database.
    I have a site that works fine on my local host and on the server but now Ive jus posted, the "working site" onto the ftp folder of the company that hosts if for us.But I have found that it doesn't work coz of the read/write permissions onto the database.How can I solve this coz I have granted read/write permissions in the database properties.

    But I keep getting this error when I try to login.:Error # -2147467259 Operation must use an updateable query.
    SQL = UPDATE tbl_employees SET lastlogin = #29-Feb-2008# WHERE employeelogin = 'SIPHOSIBUYANE'

    Here is my asp code:
    <!--
    '************************************************* ******************************************

    '************************************************* *******************************************
    -->
    <!--#include file="SiteSQL.asp"-->
    <%
    '** CONNECTION STRING
    'Dim conn
    'strConn = DB_CONNECTIONSTRING
    'set conn=server.createobject("adodb.connection")
    'conn.Open strConn
    'conn.Mode = 3
    Dim conn, ConnectString
    ConnectString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("data/intranet.mdb") & ";Persist Security Info=False"
    Set conn = Server.CreateObject("ADODB.Connection")
    conn.open ConnectString
    %>
    <%
    Private function RunSQL(ByVal sql,ByRef myRS)
    'Response.Write sql & "<BR>"
    On Error Resume Next
    if lcase(left(trim(sql),6)) = "select" then
    set myRS = server.CreateObject("adodb.recordset")
    myRS.open sql,conn,3,3
    else
    select case lcase(left(trim(sql),6))
    case "update", "delete"
    if instr(lcase(sql),"where") = 0 then
    response.write "Dork, you tried to run a "& lcase(left(trim(sql),6)) &" query without the where clause!"
    boolDoNotRunQuery = true
    response.end
    end if
    end select
    if boolDoNotRunQuery <> true then
    set myRS = conn.Execute(sql)
    end if
    end if
    if err.number <> 0 then
    Response.Clear
    Response.Write "Error Occured:<BR><BR>"
    Response.Write "Error # " & CStr(Err.Number) & " " & Err.Description & "<BR>"
    Response.Write "SQL = " & sql & "<BR>"
    Response.End
    End if
    On Error Goto 0
    end Function

    Private function DoSQL(ByVal sql)
    'Response.write sql & "<BR>"
    On Error Resume Next
    boolDoNotRunQuery = FALSE
    actionWord = left(trim(sql),6)
    select case lcase(actionWord)
    case "update", "delete"
    if instr(lcase(sql),"where") = 0 then
    response.write "Dork, you tried to run a "& lcase(left(trim(sql),6)) &" query without the where clause!"
    boolDoNotRunQuery = true
    response.end
    end if
    end select
    if boolDoNotRunQuery <> true then
    conn.Execute(sql)
    end if
    if err.number <> 0 then
    Response.Clear
    Response.Write "Error Occured:<BR><BR>"
    Response.Write "Error # " & CStr(Err.Number) & " " & Err.Description & "<BR>"
    Response.Write "SQL = " & sql & "<BR>"
    Response.End
    End if
    On Error Goto 0
    end Function

    Im better with asp.net, so even if someone can help me remove the update statement or help me fix this problem.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    We have an asp forum for this type of thing. Its under server side languages.
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •