Dear Ruben jt johansen
I feel as if you are the only one who can help me, so please figure what's going on with my code. Its still not working. I made your corrections with some minor adjustments. When made the following 2 declarations I got an error, the declarations are:
Code:
dim DataConnection as adodb.connection
Dim objRS as adodb.recordset
I got an error with the 'as *.connection and as *.recordset' so I took off that part. I am not assuming anything here so I'll take the opportunity to asky you, do I have to include the adovbs.inc file? Okay so with those minor adjustments here's the code:
Code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<% Option Explicit %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Lock Types</title>
</head>
<body>
<%
dim DataConnection
Dim objRS
Dim adOpenDynamic
Dim adLockPessimistic
adOpenDynamic = 2
adLockPessimistic = 2
set DataConnection = Server.CreateObject("ADODB.Connection")
Set objRS = Server.CreateObject("ADODB.recordset")
DataConnection.mode=3 'same as readwrite
objRS.Open "boats","DSN=lock",adOpenDynamic,adLockPessimistic
if not objRS.eof then
objRS.movefirst
Response.Write "<p>" & objRS("boat") & "</p>"
objRS("boat") = "Lyrics"
objRS.Update
end if
Response.Write objRS("boat") & "<p>"
objRS.Close
Set objRS = Nothing
dataconnection.close
set dataconnection = Nothing
%>
</body>
</html>
And here's the error message I am getting:
Code:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Cannot update. Database or object is read-only.
/asp/lock_types/lock_a.asp, line 30
By the way, line 30 is the following line:
I really really hope you can help me, I am studying asp on my own using the WROX books and I have no tutor to ask anything. Out in the cold here.