Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old February 27th, 2007, 02:55 AM
Authorized User
 
Join Date: May 2006
Location: hubli, karnataka, India.
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
Reply With Quote
  #2 (permalink)  
Old February 27th, 2007, 08:05 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
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
Reply With Quote
  #3 (permalink)  
Old February 27th, 2007, 12:56 PM
Friend of Wrox
 
Join Date: May 2006
Location: San Diego, CA, USA.
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
Reply With Quote
  #4 (permalink)  
Old February 28th, 2007, 02:40 AM
Authorized User
 
Join Date: May 2006
Location: hubli, karnataka, India.
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
Reply With Quote
  #5 (permalink)  
Old February 28th, 2007, 04:25 PM
Friend of Wrox
 
Join Date: May 2006
Location: San Diego, CA, USA.
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
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 06:43 AM
Updating the record in database lwebzem ASP.NET 1.0 and 1.1 Basics 4 March 8th, 2006 08:40 AM
Updating the record in the database lwebzem ASP.NET 1.0 and 1.1 Basics 3 February 28th, 2006 06:57 AM
Record not updating Tangerine ASP.NET 1.x and 2.0 Application Design 3 March 24th, 2004 11:00 AM



All times are GMT -4. The time now is 06:12 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.