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 August 30th, 2006, 04:15 AM
Authorized User
Join Date: May 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem in Updating a record using a form

presently i m in a project of real estate website developement... her ei m getting a problem at modifying a members profile.... it contains a form.. which display a the members details..ina a form from that they can modify their data.. when they modify and click on submit then there is another page to update taht record... i m having eror in that second page; here is the code;

'Dimension variables
Dim adoCon 'Holds the Database Connection Object
Dim rs 'Holds the recordset for the records in the database
Dim strSQL 'Holds the SQL query for the database
Dim lngRecordNo 'Holds the record number to be updated

'Read in the record number to be updated
strl = session("log")

'Create an ADO connection object
Set adoCon = Server.CreateObject("ADODB.Connection")

'Set an active connection to the Connection object using a DSN-less connection
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("db/newuser.mdb")

'Set an active connection to the Connection object using DSN connection
'adoCon.Open "DSN=guestbook"

'Create an ADO recordset object
Set rs = Server.CreateObject("ADODB.Recordset")

'Initialise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT members.* FROM members WHERE login=" & session("log")

'Open the recordset with the SQL query
rs.CursorType = 2
rs.LockType = 3
rs.Open strSQL, adoCon

     rs.Fields("fname") = Request.Form("edit_name")
    rs.Fields("mname") = Request.Form("edit_mid")
    rs.Fields("lname") = Request.Form("edit_last")
    rs.Fields("bday") = Request.Form("edit_day")
    rs.Fields("bmonth") = Request.Form("edit_month")
    rs.Fields("byear") = Request.Form("edit_year")
    rs.Fields("email") = Request.Form("edit_email")
    rs.Fields("add1") = Request.Form("edit_add1")
    rs.Fields("add2") = Request.Form("edit_add2")
    rs.Fields("city") = Request.Form("edit_city")
    rs.Fields("state") = Request.Form("edit_state")
    rs.Fields("country") = Request.Form("edit_country")
    rs.Fields("pin") = Request.Form("edit_pin")
    rs.Fields("businessurl") = Request.Form("edit_url")
    rs.Fields("mobile") = Request.Form("edit_mobile")
    rs.Fields("officephone") = Request.Form("edit_officeph")
    rs.Fields("homephone") = Request.Form("edit_homeph")


Set rs = Nothing
Set adoCon = Nothing

here ; session("log") -- it contains the user login name. it is assigned when user entered and varified by login....

so i m getting following error;
Microsoft OLE DB Provider for ODBC Drivers error '80040e10'

[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.

/member_edit_submit.asp, line 193

any one can help me for this... it is urgent and i m waiting for any ons's help...

Old August 30th, 2006, 06:41 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

Change your sql statement to this:

SELECT * from members

Also, you may just want to pass an Update query to access as opposed to selecting the data, pulling it down, updating it, and then pushing it back up. It seems that you have alot of unnecssary code here.

"The one language all programmers understand is profanity."
Old August 30th, 2006, 11:39 PM
Authorized User
Join Date: May 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts

i have done before as u suggested... i have also done so many type of query sting modifications.. still i m getting same error


Similar Threads
Thread Thread Starter Forum Replies Last Post
Updating first found record rtr1900 Classic ASP Databases 9 December 2nd, 2005 03:09 AM
updating record stoneman Access 1 July 5th, 2005 09:12 AM
Error updating record in bounded form method Access 0 June 19th, 2005 05:31 PM
updating and deleting record PinkyCat Classic ASP Databases 4 March 16th, 2005 05:50 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.