Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 29th, 2006, 02:51 PM
Authorized User
 
Join Date: Feb 2004
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to sinner
Default Problem updating query

Hello All,

I am trying to update a query table and keep on getting the folowing error:

Microsoft Cursor Engine error '80004005'

Insufficient key column information for updating or refreshing.

Query1edit.asp, line 263

When I manually update in Access it updatesd both of the source table fine.

<%

'-------------------------------------------------------------------------------
' Function EditData
' - Edit Data based on Key Value
' - Variables used: field variables

Function EditData()
    Dim sSql, rs, sWhere, sGroupBy, sHaving, sOrderBy
    sSql = "SELECT * FROM [Query1]"
    sWhere = ""
    sGroupBy = ""
    sHaving = ""
    sOrderBy = ""
    If sWhere <> "" Then sWhere = sWhere & " AND "
    sWhere = sWhere & "([Reference] = '" & AdjustSql(x_Reference) & "')"
    sSql = sSql & " WHERE " & sWhere
    If sGroupBy <> "" Then
        sSql = sSql & " GROUP BY " & sGroupBy
    End If
    If sHaving <> "" Then
        sSql = sSql & " HAVING " & sHaving
    End If
    If sOrderBy <> "" Then
        sSql = sSql & " ORDER BY " & sOrderBy
    End If
    Set rs = Server.CreateObject("ADODB.Recordset")
    rs.CursorLocation = 3
    rs.Open sSql, conn, 1, 2
    If rs.Eof Then
        EditData = False ' Update Failed
    Else

        ' Field Reference
        sTmp = Trim(x_Reference)
        If Trim(sTmp) = "" Then sTmp = Null
        rs("Reference") = sTmp

        ' Field Version Date
        sTmp = Trim(x_Version_Date)
        If Trim(sTmp) = "" Then sTmp = Null
        rs("Version Date") = sTmp

        ' Field Date Audited
        sTmp = Trim(x_Date_Audited)
        If Trim(sTmp) = "" Then sTmp = Null
        rs("Date Audited") = sTmp

        ' Field Competent
        sTmp = Trim(x_Competent)
        If Trim(sTmp) = "" Then sTmp = Null
        rs("Competent") = sTmp

        ' Field Auditor
        sTmp = Trim(x_Auditor)
        If Trim(sTmp) = "" Then sTmp = Null
        rs("Auditor") = sTmp

        ' Field Findings/Action Plan
        sTmp = Trim(x_Findings2FAction_Plan)
        If Trim(sTmp) = "" Then sTmp = Null
        rs("Findings/Action Plan") = sTmp
        rs.Update
        EditData = True ' Update Successful
    End If
    rs.Close
    Set rs = Nothing
End Function
%>

Any ideas????









Similar Threads
Thread Thread Starter Forum Replies Last Post
Updating query using inner join sintax error gfranco Access 0 April 18th, 2008 10:08 PM
updating table w/ query that has left join msordo VB.NET 2002/2003 Basics 4 April 11th, 2008 11:26 AM
Updating Microsoft Query KateV Excel VBA 2 August 1st, 2007 09:16 AM
problem in updating datagrid noor ASP.NET 1.0 and 1.1 Basics 1 April 26th, 2005 03:10 AM
UPDATING problem CW Classic ASP Databases 3 September 23rd, 2003 04:25 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.