
May 29th, 2000, 02:58 PM
|
|
Contributing User
|
|
Join Date: Dec 2002
Posts: 14,575
  
Time spent in forums: < 1 sec
Reputation Power: 23
|
|
|
<i><b>Originally posted by : steve</b></i><br />here is an example i put together detecting which button was clicked.<br /><br />page 1 code<br /><form method="post" name="form1" action="b2.asp"><br /><input type="text" size="20" value="5/29/2000"><br><br /><input type="submit" value="button1" name="button1"><br /><input type="submit" value="button2" name="button2"><br /></form><br /><br />Page 2 code<br /><%<br />if request("button1")="button1" Then<br /><br />response.write "Connection String 1" <br /><br />Else <br /><br />response.write "Connection String 2"<br /><br />End If <br />%><br /><br />------------<br />sarah at 5/29/2000 10:10:07 AM<br /><br />I want to use an If Then statement to designate which of two connections and sql statements will be used.<br /><br />I set up the following code for the first connection, which seems to work, but doesn't actually pass the values into the ACCESS table. Any suggestions?<br /><br /><%<br />Previous = request.form("Previous")<br />Fname = request.form("Fname")<br />Lname = request.form("Lname")<br />Title = request.form("Title")<br />State = request.form("State")<br />Phone = request.form("Phone")<br />Email = request.form("Email")<br />Options = request.form("teams")<br />ID = request.form("ID")<br /><br />If Previous = "Main" Then<br /><br />Set MyConn=Server.CreateObject("ADODB.Connection")<br />MyConn.Open "DSN=IE99"<br />MySQL="Insert into registration (Fname, Lname, Title, State, Phone, Email, Options, ID) VALUES ('" & Fname & "', " & "'" & Lname & "', " & "'" & Title & "', " & "'" & State & "', " & "'" & Phone & "', " & "'" & Email & "', " & "'" & Options & "', " & "'" & ID & "')" <br /><br />Set MyRs=MyConn.Execute(MySQL)<br /><br />End If<br /><br />%><br /><br />
|