Click here to Skip to main content
15,921,643 members
Home / Discussions / Web Development
   

Web Development

 
AnswerRe: Javascript ASP problem Pin
Curtis Schlak.2-Dec-05 21:13
Curtis Schlak.2-Dec-05 21:13 
AnswerRe: Javascript ASP problem Pin
Guffa3-Dec-05 12:17
Guffa3-Dec-05 12:17 
AnswerRe: Javascript ASP problem Pin
mjay20045-Dec-05 1:32
mjay20045-Dec-05 1:32 
QuestionHow to hide fiel name in URL Pin
vicky45730-Nov-05 6:53
vicky45730-Nov-05 6:53 
AnswerRe: How to hide fiel name in URL Pin
Ghasrfakhri30-Nov-05 19:09
Ghasrfakhri30-Nov-05 19:09 
AnswerRe: How to hide fiel name in URL Pin
Rajkamal_dfine8-Dec-05 17:32
Rajkamal_dfine8-Dec-05 17:32 
GeneralRe: How to hide fiel name in URL Pin
vicky4579-Dec-05 5:31
vicky4579-Dec-05 5:31 
QuestionDatabase IF statement help Pin
t_clarke30-Nov-05 6:33
t_clarke30-Nov-05 6:33 
I have the following code in an asp file that receives data from a form. I can not get the if statement to work correctly. The if statement should check if the user name is in the database field "name" and if true then do not submit the information and if not true run the insert function. Any help would be appreciated.

<%
' Declaring variables
Dim data_source, con, sql_select, sql_insert

' Receiving values from Form
name =(Request.Form("name"))
email =(Request.Form("email"))

data_source = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _
Server.MapPath("db.mdb")

sql_insert = "insert into tblAnswers (name, email) values values ('" & name & "', '" & email & "')

' Creating Connection Object and opening the database
Set con = Server.CreateObject("ADODB.Connection")
con.Open data_source

'Checking if user has taken survey
'sql_select = "SELECT * FROM tblAnswers"

if name = (Request.Form("name")) then

'Response.Write("You have already taken the survey")

'Else
con.Execute sql_insert
' Done. Close the connection
con.Close
Set con = Nothing
Response.Write("Thank you for taking the survey")
'End If


%>






Thomas

-- modified at 12:40 Wednesday 30th November, 2005
AnswerRe: Database IF statement help Pin
Guffa3-Dec-05 12:28
Guffa3-Dec-05 12:28 
QuestionHtmlEditor Pin
Michael Mac30-Nov-05 1:47
Michael Mac30-Nov-05 1:47 
AnswerRe: HtmlEditor Pin
Edbert P30-Nov-05 17:08
Edbert P30-Nov-05 17:08 
AnswerRe: HtmlEditor Pin
Scott Serl1-Dec-05 7:21
Scott Serl1-Dec-05 7:21 
QuestionHow to open reference in browser? (WIN API) Pin
Vladimir D29-Nov-05 21:39
Vladimir D29-Nov-05 21:39 
QuestionMicrosoft Treeview Control-Selecting a node based on a key Pin
K.P.Kannan29-Nov-05 7:05
K.P.Kannan29-Nov-05 7:05 
QuestionUrgent Help on C#~~ Pin
momoo28-Nov-05 14:43
momoo28-Nov-05 14:43 
AnswerRe: Urgent Help on C#~~ Pin
Guffa28-Nov-05 22:03
Guffa28-Nov-05 22:03 
AnswerRe: Urgent Help on C#~~ Pin
bhumber29-Nov-05 1:33
bhumber29-Nov-05 1:33 
Questionadd/save a row to a db C# Pin
bhumber28-Nov-05 8:38
bhumber28-Nov-05 8:38 
AnswerRe: add/save a row to a db C# Pin
enjoycrack28-Nov-05 12:50
enjoycrack28-Nov-05 12:50 
GeneralRe: add/save a row to a db C# Pin
bhumber29-Nov-05 1:15
bhumber29-Nov-05 1:15 
GeneralRe: add/save a row to a db C# Pin
enjoycrack29-Nov-05 6:33
enjoycrack29-Nov-05 6:33 
QuestionHelp on multiple Web Services with same Interfaces Pin
rnvrnv28-Nov-05 4:21
rnvrnv28-Nov-05 4:21 
QuestionIndex was outside the bounds of the array Pin
Cammie Watson28-Nov-05 0:13
Cammie Watson28-Nov-05 0:13 
AnswerRe: Index was outside the bounds of the array Pin
Guffa28-Nov-05 0:50
Guffa28-Nov-05 0:50 
GeneralRe: Index was outside the bounds of the array Pin
Cammie Watson28-Nov-05 4:45
Cammie Watson28-Nov-05 4:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.