Signup · Login
Stardeveloper.com  
Home · Tutorials · Forums · Web Hosting Plans · Faisal Khan's Blog · Contact
Forums : ASP : ADO/ODBC : Select + update not working together Signup · Login
Author Thread
Select + update not working together
Posted in tutorial: Updating records in the database with ASP
·  nekesa
User
Joined: 23 Jan 2007
Total Posts: 1
Select + update not working together
Posted: 24 Jan 2007
Have had the update statement and select statement working separately but cannot get them to work together.
Here is the latest attempt:

<%
Dim conn,rs,strsql,sql_update,ssn,cps
strsql = "Select SSN From CWCT07 where SSN = '" & _
Request.Form("SSN") & "'"

sql_update = "Update CWCT07 Set CPS = 'Yes' where ssn = '93737'"

'DSN less connection
set conn = server.CreateObject("ADODB.Connection")
set rs = server.CreateObject("ADODB.Recordset")
Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=d:\shared\Casework.mdb"
rs.Open strsql
conn.Execute sql_update

If (not rs.BOF) and (not rs.EOF) then
Response.Redirect "http://cwpsalem.pdx.edu/staff/Index.html"
else
Response.Redirect "http://cwpsalem.pdx.edu"
end if

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

Thanks for any help

Users Who Have Visited This Thread In Last 24 Hours
6 Visitors

Login
UserName Or Email Address:       Password:       Auto-Login:    
· Create New User Account
· Send Forgotten Password by Email
 
© 1999 - 2009 Stardeveloper.com, All Rights Reserved.