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 30th, 2004, 05:05 PM
Registered User
 
Join Date: Jan 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Unable to change DB values using ASP


Can somebody please tell me why I'm unable to update
an access database using this code:
    Dim ConnectionString
    ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\wedding.mdb"
    Dim Connection
    Set Connection = Server.CreateObject("ADODB.Connection")
    Connection.Open ConnectionString, adOpenDynamic, adLockOptimistic, adCmdText

    Set rs = Server.CreateObject("ADODB.Recordset")
    rs.open "Select * FROM Guests WHERE ID=" & Request("GuestName"), Connection

    If Request.Form("GuestNumber") = 0 Then
        Response.write "<div class='heading'>Don't forget to submit your guest number!</div>"
    Else
        If Request.Form("GuestNumber") = 6 Then
            rs("GuestStatus") = 3
        Else
            rs("GuestNumber") = Request.Form("GuestNumber")
            rs("GuestStatus") = 1
        End If
    End If

    rs.Close
    Set rs = Nothing

    Connection.Close
    Set Connection = Nothing
I'm getting a server error that the server is unable
to do procedure or some nonsense and the DB changes
are not occurring. I'm able to see the DB and populate
selects and such, just no changin' DB values.
I haven't coded in a few years, did something change
that I should know about?
 
Old January 31st, 2004, 01:45 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 111
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I would suggest you post the *exact* error message you are receiving.

However, your code appears to be incorrect. Properties like "cursortype", and "locktype" are properties of the *recordset* not the *connection*. You need to open the recordset with an updateable locktype

Cheers
Ken

Microsoft MVP - Windows Server (IIS)
www.adOpenStatic.com
 
Old January 31st, 2004, 02:04 PM
Registered User
 
Join Date: Jan 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default


Here is my error message:

Technical Information (for support personnel)

Error Type:
ADODB.Recordset (0x800A0CB3)
Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype.
/Wedding/reply.asp, line 18


Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)

Page:
POST 25 bytes to /Wedding/reply.asp

POST Data:
guestname=4&guestnumber=2



line 18 corresponds with:
rs("GuestNumber") = Request.Form("GuestNumber")





Similar Threads
Thread Thread Starter Forum Replies Last Post
forgot sa password, unable to change... help happygv SQL Server 2000 14 April 29th, 2010 02:26 AM
values dont show up on ASP page but exist in DB msoul Classic ASP Basics 2 September 3rd, 2008 02:03 PM
Unable to import db The Beginner SQL Server 2000 9 August 24th, 2006 06:03 AM
how to change values in asp:bound field hertendreef ASP.NET 2.0 Professional 3 May 31st, 2006 08:45 AM
how to change values in asp:bound field hertendreef VS.NET 2002/2003 1 May 29th, 2006 06:45 AM





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