0

I hope someone can help me decide what is happening with this. It recognizes and carries out the select statement, will redirect to the proper place if entry is valid/invalid, but will not insert anything into the database. I first wanted an timestamp but am trying to troubleshoot backwards and simply enter text. Still no go. (Here is the code. First post. Hope I do this right)

<%
Dim conn,rs,strsql,sql_insert
set conn = server.CreateObject("ADODB.Connection")
set rs = server.CreateObject("ADODB.Recordset")

'DSN less connection
Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=d:\shared\Casework.mdb"

strsql = "Select SSN From CWCT07 where SSN = '" & _ 
Request.Form("SSN") & "'"
set rs = conn.Execute (strsql)

    
    If (not rs.BOF) and (not rs.EOF) then
    sql_insert = "insert into CWCT07 (cps) values ('Yes')"
    'response.Write(sql_Insert)
    set sql_insert = conn.Execute (sql_insert)
   Response.Redirect "http://cwpsalem.pdx.edu/staff/Index.html" 
else
   Response.Redirect "http://cwpsalem.pdx.edu"
end if

response.write strsql

'close the recordset
rs.close
set rs = nothing

'close the connection
conn.close
set conn = nothing
%>
</script>

Thanks for any help.

2
Contributors
1
Reply
2
Views
10 Years
Discussion Span
Last Post by noman78
0

hi there
it seems u r new to asp
here is ur mistake
instead of this
set sql_insert = conn.Execute (sql_insert)
use this
conn.Execute (sql_insert)

it will work

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.