×

Loading...
Ad by
  • 推荐 OXIO 加拿大高速网络,最低月费仅$40. 使用推荐码 RCR37MB 可获得一个月的免费服务
Ad by
  • 推荐 OXIO 加拿大高速网络,最低月费仅$40. 使用推荐码 RCR37MB 可获得一个月的免费服务

AsP & Access insert into or update can't be exceuted help please

本文发表在 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('&Iacute;&not;already exist');"&"window.location.href = 'index.asp'"&" </script>"
set rs1=nothing
else
response.write "<script language=JavaScript>" & chr(13) & "alert('&acute;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
Report

Replies, comments and Discussions:

  • 工作学习 / 专业技术讨论 / AsP & Access insert into or update can't be exceuted help please
    本文发表在 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('&Iacute;&not;already exist');"&"window.location.href = 'index.asp'"&" </script>"
    set rs1=nothing
    else
    response.write "<script language=JavaScript>" & chr(13) & "alert('&acute;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
    • if name and card_id are user defined variables, you do not need to put quotation marks around them. i guess. try test your sql query within access.
    • delete rs1.Open sql,conn,1,3