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 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Database update not working



    I’m getting this error with the following asp page trying to update an access database.
    Anyone got any ideas?

    ADODB.Recordset error '800a0bb9'
    Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
    /admin/homesave.asp, line 25


    <%@ Language="VBScript" %>
    <% Option Explicit %>
    <!--#include file="includes/adovbs.inc"-->
    <%
    Dim dbPath, dbConn, dbRS, redirURL, site, pageheading, button

    site = cstr(Request.form("site"))
    pageheading = cstr(Request.form("pageheading"))
    button = cstr(Request.form("button"))

    if button = " Edit " then
    redirURL = "site=" &Server.URLencode(site)
    redirURL = redirURL & "&pageheading=" &Server.URLencode(pageheading)
    redirURL = "home.asp?"&redirURL
    Response.Redirect redirURL
    else
    dbPath = "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=d:\ace.mdb"

    Set dbConn = Server.CreateObject("ADODB.Connection")
    dbConn.Open = dbPath

    Set dbRS = Server.CreateObject("ADODB.Recordset")
    dbRS.Open "Home", dbConn, adOpenDynamic, adLockOptimistic, adCmdTable

    dbRS.Find "siteID =" & site ‘LINE 25

    dbRS("siteID") = site
    dbRS("pageheading") = pageheading
    dbRS.Update

    dbRS.Close
    set dbRS = Nothing

    Response.Clear
    Response.Redirect "welcome.asp"
    End If

    dbConn.close
    set dbConn = nothing
    %>

  • #2
    Regular Coder
    Join Date
    Aug 2002
    Location
    USA
    Posts
    478
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Don't know the nature of the fields and thus if changing this:

    dbRS.Find "siteID =" & site

    To this might work (i.e. adding single quotes around the value because the field is a text field):

    dbRS.Find "siteID ='" & site & "'"

    And of course first perhaps check to be sure that the site variable isn't actually blank.
    J. Paul Schmidt
    www.Bullschmidt.com - Freelance Web and Database Developer
    www.Bullschmidt.com/DevTip.asp - Classic ASP Design Tips

  • #3
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Bullschmidt,

    That fixed it.

  • #4
    Regular Coder
    Join Date
    Aug 2002
    Location
    USA
    Posts
    478
    Thanks
    0
    Thanked 2 Times in 2 Posts
    You're welcome - glad to hear that the shot in the dark actually worked!
    J. Paul Schmidt
    www.Bullschmidt.com - Freelance Web and Database Developer
    www.Bullschmidt.com/DevTip.asp - Classic ASP Design Tips


  •  

    Posting Permissions

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