Previous Thread
Next Thread
Print Thread
Rate Thread
#17650 10/27/02 01:18 PM
Joined: Oct 2002
Posts: 10
Junior Member
Junior Member
Joined: Oct 2002
Posts: 10
Okay, so I'm having some trouble! I've never jacked with ADO before today, and so I started playing with it. No problem... created a very basic access database with a single table with some fields, and I can read from it and pipe the output to tables no problem. Yay!

Now, I'm trying to get the first field in each record that is displayed to have the data on a button, and where clicking the button will take you to a new page with a form that lets you edit the database. Now, the hard part ought to be the DB edit itself, but I've got that part working alright. I'm screwing up a really simple IF statement, and it's pissing me off. No matter what I do, the display isn't on a button, which means that I can't do action="edit.asp" and actually get to my edit script.... Here's the relevant lines:

Code
<tr>
<form method="post" action="edit.asp">
<%for each x in rs.Fields
      if x.name="no" then%>
           <td><input type="submit" name="no" value="<%=x.value%>"></td>
      <%else%>
           <td><%Response.Write(x.value)%></td>
      <%end if
next
%>
</form>
<%rs.MoveNext%>
</tr>
What am I not doing correctly here? The display is just the value of the "no" field in the table, never the button with the value on it as text linking me to my other script.

Help?

Sponsored Links
▼ Sponsored Links ▼ ▲ Sponsored Links ▲
Joined: Mar 2002
Posts: 1,273
DollarDNS Owner
DollarDNS Owner
Joined: Mar 2002
Posts: 1,273
Code
<tr>
<form method="post" action="edit.asp">
<%
for each x in rs.Fields
    if x.name="no" then
        Response.Write "<td><input type=""submit"" name=""no"" value=""" & x.value & """></td>"
    else
        Response.Write "<td>" & x.value & "</td>"
    end if
    rs.MoveNext
next
%>
</form>
</tr>
Give that a shot.


Domain Registration, Hosting, Management
http://www.dollardns.net

Link Copied to Clipboard
Member Spotlight
None yet
Forum Statistics
Forums41
Topics33,840
Posts68,858
Members2,176
Most Online3,253
Jan 13th, 2020
Latest Postings
Top Posters
UGN Security 41,392
Gremelin 7,203
§intå× 3,255
SilentRage 1,273
Ice 1,146
pergesu 1,136
Infinite 1,041
jonconley 955
Girlie 908
unreal 860
Top Likes Received
Ghost 2
Dartur 1
Cyrez 1
Girlie 1
unreal 1
Powered by UBB.threads™ PHP Forum Software 8.0.0