ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old May 29th, 2000, 01:10 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 23
using If Then with dsn connection and sql

<i><b>Originally posted by : sarah (sdcarrig@uncg.edu)</b></i><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 />

Reply With Quote
  #2  
Old May 29th, 2000, 02:58 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
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 />

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > using If Then with dsn connection and sql


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT