Newsgroups: microsoft.public.inetserver.asp.db
From: "Bob Barrows [MVP]" <reb01...@NOyahoo.SPAMcom>
Date: Fri, 18 Feb 2005 14:48:33 -0500
Local: Fri, Feb 18 2005 2:48 pm
Subject: Re: Problem with AddNew method while adding record
Jack wrote: I'm not sure why you are getting this error. I suspect it is due to the > Hi, > I am testing a small asp page where addnew method is applied to add > record to a table. However, I am getting the following error: > Unspecified error > Line 35 is goes as follows: reserved word you are using for one of your column names (Name). Anyways, in ASP, it is not recommended that you use a recordset to modify data. Recordsets should only be used to retrieve read-only data for display purposes. Your application will be much more scalable if you learn to use SQL DML (SQL Data Modification Language): INSERT,UPDATE and DELETE statements. See below: > myDSN="DRIVER={Microsoft Access Driver (*.mdb)}; " OLE DB Provider anyways: myDSN="Provider=Microsoft.Jet.OLEDB.4.0;" & _ > set CN=server.createobject("ADODB.Connection") > 'Store the input values in the form to the above defined variable > l_Name = Request.Form("txtName") > 'Using the above variable values update the People table sSQL = "INSERT INTO People (Name,ColorPreference," & _ "Age,IsChecked) VALUES(?,?,?,?)" set cmd=createobject("adodb.command") Better yet would be to use a saved parameter query. See: http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&c2coff=1&selm=ukS%... http://www.google.com/groups?selm=eETTdnvFDHA.1660%40TK2MSFTNGP10.phx... http://www.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=e6lLVvO... HTH, You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||