Soldato
- Joined
- 13 Feb 2004
- Posts
- 2,656
- Location
- South Shields
Alreeet.
For some reason is always the simple things that I get errors on.. but I can plough through some of the more complex stuff..
So.. I'm having problems with an If, Then, Else statement
When the user inputs their forename I want the asp page to check the forename and make sure that it is only constructed with letters.. and no numbers or symbols.
Therefore I have created this code..
However it constantly shows the Salutation & " " & Surname & " you have been successfully added to our email list line but never actually adds the information to the database.
Any ideas.. have I missed anything obvious.
Also.. this input page works on IIS (if I comment out the If, Then, Else) and adds a user to the database. However it does not work on my ASP enabled host. Could this be a directory issue?
Thanks for looking
For some reason is always the simple things that I get errors on.. but I can plough through some of the more complex stuff..
So.. I'm having problems with an If, Then, Else statement

When the user inputs their forename I want the asp page to check the forename and make sure that it is only constructed with letters.. and no numbers or symbols.
Therefore I have created this code..
<%
'Open the database connection
Set Con = Server.CreateObject( "ADODB.Connection" )
Con.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("Members.mdb")
%>
<%
'Add new member
sqlAddMember ="INSERT INTO Members ( `Member Salutation`, `Member Forename`, `Member Surname`, `Member Email Address`) VALUES ('" & Salutation & "', '" & Forename & "', '" & Surname & "', '" & Email & "')"
If Forename.contenttype="text" Then con.execute sqlAddMember
'Display confirmation message to the user.
Response.Write( Salutation & " " & Surname & " you have been successfully added to our email list")
Else Response.Write("There has been an error with your submission")
End If
%>
However it constantly shows the Salutation & " " & Surname & " you have been successfully added to our email list line but never actually adds the information to the database.
Any ideas.. have I missed anything obvious.
Also.. this input page works on IIS (if I comment out the If, Then, Else) and adds a user to the database. However it does not work on my ASP enabled host. Could this be a directory issue?
Thanks for looking
