I've set up my database and have a table. I'm trying to use the ADO Connection object and recordset object to connect to the database and insert a query from a HTML form. The database is on a remote server at Lunarpages.com. I'm getting the error message below. I've tried reconfiguring the database but still won't work.
Error Type:
ADODB.Recordset.1 (0x80004005)
Recordset is read-only
the code reads in part as follows--
strFname = request.form("fname")
strLname = request.form("lname")
strStreet = request.form("street")
strCity = request.form("city")
strState = request.form("state")
intZip = request.form("zip")
intPhone = request.form("phone")
intNum = request.form("number")
intTime = request.form("time")
intDate = request.form("date")
strEmail = request.form("email")
set objConn = server.createobject("ADODB.connection")
set objRS = server.createobject("ADODB.recordset")
strConnectionString = "Driver={mySQL}; Server=localhost; Port=3306; Option=0; Socket=; Stmt=; Database=dbname; Uid=user; Pwd=pass;"
objConn.open strConnectionString
objRS.Open "Reservations", objConn
objRS.AddNew
objRS("fname") = strFname
objRS("lname") = strLname
objRS("street") = strStreet
objRS("city") = strCity
objRS("state") = strState
objRS("zip") = intZip
objRS("phone") = intPhone
objRS("number") = intNum
objRS("time") = intTime
objRS("date") = intDate
objRS("email") = strEmail
objRS.update
objRS.close
objConn.close
Error Type:
ADODB.Recordset.1 (0x80004005)
Recordset is read-only
the code reads in part as follows--
strFname = request.form("fname")
strLname = request.form("lname")
strStreet = request.form("street")
strCity = request.form("city")
strState = request.form("state")
intZip = request.form("zip")
intPhone = request.form("phone")
intNum = request.form("number")
intTime = request.form("time")
intDate = request.form("date")
strEmail = request.form("email")
set objConn = server.createobject("ADODB.connection")
set objRS = server.createobject("ADODB.recordset")
strConnectionString = "Driver={mySQL}; Server=localhost; Port=3306; Option=0; Socket=; Stmt=; Database=dbname; Uid=user; Pwd=pass;"
objConn.open strConnectionString
objRS.Open "Reservations", objConn
objRS.AddNew
objRS("fname") = strFname
objRS("lname") = strLname
objRS("street") = strStreet
objRS("city") = strCity
objRS("state") = strState
objRS("zip") = intZip
objRS("phone") = intPhone
objRS("number") = intNum
objRS("time") = intTime
objRS("date") = intDate
objRS("email") = strEmail
objRS.update
objRS.close
objConn.close