Date: 04/08/05 (Asp Dot Net) Keywords: database, asp, sql, microsoft Hello peoples, I am having a bitta trouble with my code and can't seem to find an answer. Im currently running XP Pro with SP2, IIS 5.1, and try to do a simple DSNless SQL Update from a form connecting to a Access 2000 database. The ASP code is as follows. <% Dim strDataPath, objConnection strDataPath = Server.MapPath("rest.mdb") Set objConnection = Server.CreateObject("ADODB.Connection") strConnectString = "Provider=Microsoft.Jet.OLEDB.4.0;"_ + " Data Source= " & strDataPath & ";" objConnection.ConnectionTimeout = 15 objConnection.CommandTimeout = 10 objConnection.Mode = 3 if objConnection.State = 0 then objConnection.Open strConnectString end if Dim strSQL, objRS strSQL = "SELECT * FROM food" Set objRS = Server.CreateObject("ADODB.RecordSet") objRS.Open strSQL, objConnection,3,3 objRS.AddNew objRS("tableno") = Request.Form("tableno") tableno = Request.Form("tableno") objRS("people") = Request.Form("people") people = Request.Form("people") objRS.Update Set objRS = Nothing objConnection.Close Set objConnection = Nothing Response.Redirect("placeorder2.asp?tableno=") + tableno + "&people=" + people %> This is the error I get. Error Type: Microsoft JET Database Engine (0x80040E09) Cannot update. Database or object is read-only. /rest/placeorder1-1.asp, line 20 What am I doing wrong? Source: http://www.livejournal.com/community/aspdotnet/31731.html
|