Hi @ll!
I'm new at ADO and I'm trying to learn about it. I solved some problems already but I really don't know what to do about this one.
This is the problem. I've created a simple asp page with this code:
<!-- #INCLUDE file="functions.inc" -->
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<p>
<% AddProd %>
</body>
</html>
And the function:
<% Sub AddProd()
' Get link info
dim CatID
CatID = Request.QueryString()
dim Prod_Name, Prod_weigth, Prod_Units, Prod_Unit_Pr
Prod_Name = Request.Form("prod_name")
Prod_weigth = Request.Form("prod_weigth")
Prod_Units = Request.Form("prod_units")
Prod_Unit_Pr = Request.Form("prod_unit_pr")
' Setting ADO Connection
set adoConn = server.createobject("adodb.connection")
adoConn.Mode = adModeReadWrite
adoConn.open connSrc
' Setting AddRs Recordset
set AddRs = server.createobject("adodb.recordset")
addRs.open "Products", adoConn, adOpenStatic, adLockPessimistic
addRs.AddNew
addRs("Product Name") = Prod_Name
addRs("Product Weigth") = Prod_Weigth
addRs("Product Name") = Prod_Units
addRs("Product Name") = Prod_Unit_Pr
addRs.Update
'Cleanup Recordset
addRs.close
set addRs = nothing
'Cleanup Connection
adoConn.close
set adoConn = nothing
End Sub
%>
My browser returns the following error:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][Controlador Microsoft Access de ODBC] Update not possible. Database or object read-only.
(translated from Portuguese)
I'm running windows XP SP1 and IIS 5.1 and I created a DSN to my DB.
What can I do to solve this problem?
Hope someone can help me.
Thank you @all very much,
Pedro