Guest_imported
New member
- Jan 1, 1970
- 0
Hi everyone
I had a problem with adding data into a database. The following is the code. And i will like to know what cause the problem. The problem says that :
Microsoft VBScript runtime error '800a01a8'
Object required: ''
/recordset.asp, line 21
I really can't figure out what this meant and is the code correct.
Thanks a lot
<%
Dim DataConn, RsPerson, SQL, sqlstr
Set DataConn = Server.CreateObject("ADODB.Connection"'change your server name to replace omega and name of database to replace 2K04
DataConn.ConnectionString="driver={sql server};server=CON7; database=user;DSN=localserver;PWD=sa;UID=sa;"
;line 21 Conn.Open DataConn
sqlstr = "INSERT INTO info(Student_Name, UserID, Password, Department, Year, e-mail) Values('" & request("text1" & "', '" & request("text2" & "', '" & request("password1" & "', '" & request("select2" & "', '" & request("radio1"& "', '" & request("text4" & "')"
Conn.close
Set Conn = nothing
%>
<%
if (Request("submit" <> "" then
Set RsPerson = DataConn.Execute(sqlstr)
if not RsPerson.eof then
Response.Redirect("else%>
<script>
window.alert("Invalid UserID or Password"
</script>
<%end if%>
<%end if
%>
I had a problem with adding data into a database. The following is the code. And i will like to know what cause the problem. The problem says that :
Microsoft VBScript runtime error '800a01a8'
Object required: ''
/recordset.asp, line 21
I really can't figure out what this meant and is the code correct.
Thanks a lot
<%
Dim DataConn, RsPerson, SQL, sqlstr
Set DataConn = Server.CreateObject("ADODB.Connection"'change your server name to replace omega and name of database to replace 2K04
DataConn.ConnectionString="driver={sql server};server=CON7; database=user;DSN=localserver;PWD=sa;UID=sa;"
;line 21 Conn.Open DataConn
sqlstr = "INSERT INTO info(Student_Name, UserID, Password, Department, Year, e-mail) Values('" & request("text1" & "', '" & request("text2" & "', '" & request("password1" & "', '" & request("select2" & "', '" & request("radio1"& "', '" & request("text4" & "')"
Conn.close
Set Conn = nothing
%>
<%
if (Request("submit" <> "" then
Set RsPerson = DataConn.Execute(sqlstr)
if not RsPerson.eof then
Response.Redirect("else%>
<script>
window.alert("Invalid UserID or Password"
</script>
<%end if%>
<%end if
%>