Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

creating a SQL update statement using forms collection

Status
Not open for further replies.

blexman

Programmer
Jul 18, 2001
34
0
0
CA
I have a form with 96 fields. I need to find a way to create an SQL Update statement for all these fields without explicitly specify each field in my asp file.

Can this be done from the form collection ?

I know you can get the form element values like this :

For Each MyItem in Request.Form
Response.Write Request.Form(MyItem).Item
Next

but how do I get the SQL server table columns names ? Can I get it from the Command Object ?

thanks
hanton
 
q = "SELECT * FROM tableA"

rs.open q, conn

For Each col in rs.Fields
Response.write col.name & &quot;<br>&quot;
Next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top