How to Update a record in Frontpage on an Access Database

H

Helena

Hi ther

I need some help her

How do I update a whole record, not just a field in a database. I am using Frontpage 2000 and Access 2000 with ASP pages

Here is the code I used, I might be waaaaay off, but nevertheless, it is not working

UPDATE DISTINCTROW
users
SET Name='::Name::
SET Surname='::Surname::'
SET Username='::Surname::
SET Password='::password::

Please help... my other alternative is to do it one field at a time and that will look a bit wierd

I will appreciate any help I can get
 
K

Kevin Spencer

Hi Helena,

I'm arfraid you're waaaaay off. A SQL UPDATE statement updates whole
records, not fields. The WHERE clause in the statement indicates which
records to UPDATE, and if you omit it, as in your example, it UPDATEs ALL
records! So, in order to update a single record, you have to pass a value
into the WHERE clause that uniquely identifies that record. Example:

UPDATE [users] SET [Name] = '::Name::', [Surname] = '::Surname::',
[UserName] = '::Surname::', [Password] = '::password::'
WHERE [Userid] = ::UserId::

Note that I enclosed the names of database objects in square brackets.
Although this is not necessarily required, it looks like at least one if not
more of your table column names were named with Access reserved words. The
square brackets help the database to identify that these are database object
names, rather than reserved words. Also note the commas, which your
statement didn't have. The column names in the query indicate which column
values to change in each record updated. Finally, I don't know what column
or columns in your table uniquely identify it. In some cases, there may be
more than one, in which case your WHERE clause might look like the
following:

WHERE [SomeTextColumn] = '::Value::'
AND [SomeNumericColumn] = ::SomeNumericValue::
AND [SomeDateColumn] = #::SomeDateValue::#

Note the use of punctuation in this example. Data Types in the table are
identified by the punctuation used to delimit their values in the SQL
Statement. Text values are enclosed with single quotes. Numeric values have
no pnctuation. Date values are enclosed with "#" characters (Access only on
the dates - most other dbs use single quotes for dates).

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

Helena said:
Hi there

I need some help here

How do I update a whole record, not just a field in a database. I am using
Frontpage 2000 and Access 2000 with ASP pages.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top