本文发表在 rolia.net 枫下论坛<% name=request("text1")
card_ID=request("text2")
set rs=server.createobject("adodb.recordset")
set rs1=server.createobject("adodb.recordset")
sql="select * from employee where name='"&name&"'"
rs.Open sql,conn,1,1
if rs.EOF or rs.bof then
sql="insert into employee(name,card_ID,mobile,address,backup) values('"&name&"','"&card_ID&"','"&mobile&"','"&address&"','"&backup&"')"
rs1.Open sql,conn,1,3
conn.execute sql
response.write "<script language=JavaScript>" & chr(13) & "alert('ͬalready exist');"&"window.location.href = 'index.asp'"&" </script>"
set rs1=nothing
else
response.write "<script language=JavaScript>" & chr(13) & "alert('´add succes');" & "history.back()" & "</script>"
end if
rs.Close
set rs=nothing
%>
I use
set conn=server.createobject("ADODB.connection)
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:/webdata/emplyee.mdb"
set rs=server.createobject("adodb.recordset") as instead of above
prompt error, need a queryable statement.
I don't know what's wrong , please give me some tips
thank you so much更多精彩文章及讨论,请光临枫下论坛 rolia.net
card_ID=request("text2")
set rs=server.createobject("adodb.recordset")
set rs1=server.createobject("adodb.recordset")
sql="select * from employee where name='"&name&"'"
rs.Open sql,conn,1,1
if rs.EOF or rs.bof then
sql="insert into employee(name,card_ID,mobile,address,backup) values('"&name&"','"&card_ID&"','"&mobile&"','"&address&"','"&backup&"')"
rs1.Open sql,conn,1,3
conn.execute sql
response.write "<script language=JavaScript>" & chr(13) & "alert('ͬalready exist');"&"window.location.href = 'index.asp'"&" </script>"
set rs1=nothing
else
response.write "<script language=JavaScript>" & chr(13) & "alert('´add succes');" & "history.back()" & "</script>"
end if
rs.Close
set rs=nothing
%>
I use
set conn=server.createobject("ADODB.connection)
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:/webdata/emplyee.mdb"
set rs=server.createobject("adodb.recordset") as instead of above
prompt error, need a queryable statement.
I don't know what's wrong , please give me some tips
thank you so much更多精彩文章及讨论,请光临枫下论坛 rolia.net