Any help will be greatly appreciated.
i want to insert general information into a database. the problem is that when run, it goes into the if statement and displays the page choose.asp but the information from the form is not going into the database!!
any thoughts to why this is?????
Heres the code:
<%
'Dimension variables
Dim connection
Dim check
Dim data
Dim insert
Dim query
Set connection = Server.CreateObject("ADODB.Connection"
Call connection.Open("credit"
query = "SELECT * FROM credInfo WHERE cardNum = '" & _
CStr (Request ("cardNum"
) &"'"
Set data = Server.CreateObject("ADODB.RecordSet"
Call data.Open(query, connection)
On Error Resume Next
If data.EOF Then
insert = "INSERT INTO credInfo VALUES ('" & _
CStr (Request ("name"
) & "','" & _
CStr (Request ("add1"
) & "','" & _
CStr (Request ("add2"
) & "','" & _
CStr (Request ("tele"
) & "','" & _
CStr (Request ("cardType"
) & "','" & _
CStr (Request ("cardNum"
) & "','" & _
CStr (Request ("exp"
) & "')"
Call connection.Execute(insert)
Call data.Close()
Call connection.Close()
Call Response.Redirect("choose.asp"
Else
Call data.Close()
Call connection.Close()
Call Response.Redirect("incorrect.asp"
End If
%>
i want to insert general information into a database. the problem is that when run, it goes into the if statement and displays the page choose.asp but the information from the form is not going into the database!!
any thoughts to why this is?????
Heres the code:
<%
'Dimension variables
Dim connection
Dim check
Dim data
Dim insert
Dim query
Set connection = Server.CreateObject("ADODB.Connection"
Call connection.Open("credit"
query = "SELECT * FROM credInfo WHERE cardNum = '" & _
CStr (Request ("cardNum"
Set data = Server.CreateObject("ADODB.RecordSet"
Call data.Open(query, connection)
On Error Resume Next
If data.EOF Then
insert = "INSERT INTO credInfo VALUES ('" & _
CStr (Request ("name"
CStr (Request ("add1"
CStr (Request ("add2"
CStr (Request ("tele"
CStr (Request ("cardType"
CStr (Request ("cardNum"
CStr (Request ("exp"
Call connection.Execute(insert)
Call data.Close()
Call connection.Close()
Call Response.Redirect("choose.asp"
Else
Call data.Close()
Call connection.Close()
Call Response.Redirect("incorrect.asp"
End If
%>