|
 |
asp_database_setup thread: Regarding to the previous problem....
Message #1 by "Angelina Harman" <angelinaq2002@y...> on Fri, 27 Jul 2001 03:28:37
|
|
Hi Ken,
At this point, we want an UPDATE query that can retrieve all the current
fieldnames. For instance, I am an admin and I have the right to update or
delele information. In my SQL Server, I have a table calls Customers.
Customers table has 3 fieldnames (ID, firstname, lastname------datatype:
they are all varchar---do not ask me why ID column is not int type or
autonumber---I make them all varchar because I want to keep them simple.
I know this is not good but let's just leave it like that for now).
Now, if I want to update or delete records from Customers table, I don't
want to go through database and make the changes there. I want to do it
on the web interface.
SO, the first thing I need to do is to display all the records from my
database to my web interface which I did sucessfully.
On this web interface, I have two links, one is called UPDATE, the other
is called DELETE.
Now, in my UPDATE page, I don't want to hard-code all the fieldnames. I
want to use a LOOP to loop through all my fieldnames and retrieve them for
me. Imagine if a new fieldname (not a record) is added to this page, I
want that new fieldname to be displayed in the UPDATE form automatically
without me going back to my UPDATE query and add that new fieldname in.
Message #2 by "Ken Schaefer" <ken@a...> on Sat, 28 Jul 2001 16:46:50 +1000
|
|
Angelina,
You need two bits of code. One to display the stuff in the webpage in the
first place.
You need another bit of code later one to construct your SQL statement. Now
you say you've done the first bit. The second can probably be accomplished
by looping through the Request.Form collection on the page you've submitted
the data to, ala:
For each x in Request.Form
Response.Write(x & " = " & Request.Form(x) & "<br>" & vbCrLf)
Next
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
----- Original Message -----
From: "Angelina Harman" <angelinaq2002@y...>
To: "ASP Database Setup" <asp_database_setup@p...>
Sent: Friday, July 27, 2001 3:28 AM
Subject: [asp_database_setup] Regarding to the previous problem....
: Hi Ken,
:
: At this point, we want an UPDATE query that can retrieve all the current
: fieldnames. For instance, I am an admin and I have the right to update or
: delele information. In my SQL Server, I have a table calls Customers.
: Customers table has 3 fieldnames (ID, firstname, lastname------datatype:
: they are all varchar---do not ask me why ID column is not int type or
: autonumber---I make them all varchar because I want to keep them simple.
: I know this is not good but let's just leave it like that for now).
:
: Now, if I want to update or delete records from Customers table, I don't
: want to go through database and make the changes there. I want to do it
: on the web interface.
:
: SO, the first thing I need to do is to display all the records from my
: database to my web interface which I did sucessfully.
:
: On this web interface, I have two links, one is called UPDATE, the other
: is called DELETE.
:
: Now, in my UPDATE page, I don't want to hard-code all the fieldnames. I
: want to use a LOOP to loop through all my fieldnames and retrieve them for
: me. Imagine if a new fieldname (not a record) is added to this page, I
: want that new fieldname to be displayed in the UPDATE form automatically
: without me going back to my UPDATE query and add that new fieldname in.
:
:
: ---
: Search the best ASP Web sites using CodeHound! http://www.codehound.com
: Now it's easy to find ASP source code on the Internet. CodeHound's free
: search engine will categorize your results and even search for ASP code
: compressed in Zip files on the Internet. Stop searching dozens of
: different sites to find what you want...try CodeHound right now!
ken@a...
$subst('Email.Unsub')
|
|
 |