Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." 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 Basics 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 February 27th, 2007, 03:55 AM
Authorized User
 
Join Date: May 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Updating database record

hi everyone,
i m getting a error with a asp page wich edit a database record. below is the code;

<%
Dim DataConnection, cmdDC, RecordSet
Dim RecordToEdit, Updated
dim id

Set DataConnection = Server.CreateObject("ADODB.Connection")
DataConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
  "Data Source=" & Server.MapPath("dbbzr/bazdb.mdb") & ";" & _
  "Persist Security Info=True"


Set cmdDC = Server.CreateObject("ADODB.Command")
cmdDC.ActiveConnection = DataConnection
id = request.form("id")

SQL = "Select * From bazaaradmin Where id=" &CLng(id)& ""


cmdDC.CommandText = SQL
Set RecordSet = Server.CreateObject("ADODB.Recordset")

RecordSet.Open cmdDC, , 0, 2

Recordset.Fields("adminlog") = request.Form("adminlog")
Recordset.Fields("adminpass") = request.Form("adminpass")
Recordset.Fields("adminemail") = request.Form("adminemail")
Recordset.Fields("adminname") = request.Form("adminname")
Recordset.Fields("adminurl") = request.Form("adminurl")
Recordset.Fields("admincontact") = request.Form("admincontact")
Recordset.Fields.update

%>


and i am getting following error in browser;

Error Type:
Provider (0x80004001)
Not implemented
/bazaar/admin-edit-done.asp, line 45


anyone help me.....thanks in advance

shri
__________________
shri
 
Old February 27th, 2007, 09:05 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

What line is line 45

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html

Discussion:
http://p2p.wrox.com/topic.asp?TOPIC_ID=56429
 
Old February 27th, 2007, 01:56 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I would suggest that you change this line:
Recordset.Fields.update
To
RecordSet.Update

You don't want to update the fields collection, you want to update the record.

Also, you are opening the recordset as a forward only cursor, which is read only (that is - not updatable).

Change this line:
RecordSet.Open cmdDC, , 0, 2
to
RecordSet.Open cmdDC, , 2, 2

You might need to experiment with the cursor type and lock type, but I suspect that the fixes above will help.

I would also suggest that you DON'T NAME YOUR RECORDSET OBJECT "RECORDSET". This is inviting trouble. Name it rs, or rsAdmin, or something other than RecordSet. This is just common naming standards practice. Naming an object by the same name as the class it is of will at the very least cause opaque and unreadable code.

Woody Z
http://www.learntoprogramnow.com
How to use a forum to help solve problems
 
Old February 28th, 2007, 03:40 AM
Authorized User
 
Join Date: May 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

--------------------------------
Thanks for your help.... it is worked and solver mine problem....thanks lot..and thanks for your other suggestions..thnks lot friend

shri
 
Old February 28th, 2007, 05:25 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No problem. Glad to be of service!

Woody Z
http://www.learntoprogramnow.com
How to use a forum to help solve problems





Similar Threads
Thread Thread Starter Forum Replies Last Post
updating database after record deletion marcstrong Visual Basic 2008 Essentials 1 July 22nd, 2008 05:25 PM
ASP.NET 2.0 Updating Database Record columth06 ASP.NET 2.0 Basics 0 November 4th, 2006 07:43 AM
Updating the record in database lwebzem ASP.NET 1.0 and 1.1 Basics 4 March 8th, 2006 09:40 AM
Updating the record in the database lwebzem ASP.NET 1.0 and 1.1 Basics 3 February 28th, 2006 07:57 AM
Record not updating Tangerine ASP.NET 1.x and 2.0 Application Design 3 March 24th, 2004 12:00 PM





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