connection objConn '连接数据库
objConn.BeginTrans '启动事务
'保存用户注册信息
strSql = "INSERT INTO members(userName, userPass, nickName, locus, email, inviteName, joinTime, activeString, activeExpires) VALUES('"& strUserName &"', '"& strPassEncry &"', '"& strNickName &"', '"& strLocus &"', '"& strEmail &"', '"& strInvite &"', '"& Now() &"', '"& strActive &"', '"& Date()+3 &"')"
objConn.Execute(strSql)
'发生错误,回滚事务
If objConn.Errors.Count > 0 Then
objConn.Errors.Clear
objConn.RollBackTrans
End If
'保存用户教育信息
strSql = "INSERT INTO education(userName, eduCode) VALUES('"& strUserName &"', '"& strCollege &"')"
objConn.Execute(strSql)
'发生错误,回滚事务
If objConn.Errors.Count > 0 Then
objConn.Errors.Clear
objConn.RollBackTrans
End If
objConn.CommitTrans '提交事务
destroy objConn '关闭数据库