<% dim conn,strSQL,rs dim name,psw,email,sex,birthday set conn = Server.CreateObject("ADODB.Connection") set rs = Server.CreateObject("ADODB.Recordset")
'If rs.State = 1 Then '如果结果集已经打开则关闭并赋为空 'rs.Close 'Set rs = Nothing 'End If 'If conn.State = 1 Then '如果连接已经打开则关闭并赋为空 ' conn.Close 'Set mycn = Nothing 'End If
conn.ConnectionString="Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=chat;Data Source=." conn.open conn.CursorLocation = adUseClient
name=request.form("t1") psw=request.form("t2") email=request.form("t4") sex=request.form.("r1")
if request.form("birthdayYear")="请选择" or request.form("birthdayMonth")="请选择" or request.form("birthdayDate")="请选择" then birthday="不详" else birthday="request.form('birthdayYear')"&"-"&"request.form('birthdayMonth')"&"-"&"request.form('birthdayDate')" end if
strSQL="insert into user values('"& name &"','"& psw &"','"& email &"','"& sex &"','"& birthday &"')"
'set rs = conn.execute (strSQL,,adCmdText) rs.open strSQL,conn,1,3 %>