Read-Only error when writing to Access database

  • Thread starter Thread starter Stephen D Cook
  • Start date Start date
S

Stephen D Cook

Dim objConn
objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "DSN=DCTRepair"
objConn.Open()
Dim objRS
objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open("TechEntry", objConn, 2, 3, 2)
objRS.AddNew()
objRS("SerialNumber") = TextBox1.Text
objRS("TechNumber") = TextBox2.Text
'objRS.MoveLast()

objRS.Update()
objRS.MoveFirst()

objConn.Close()
objConn = Nothing
End Sub

The code above works fine till I try to update or use the MoveLast
option for the database. Any ideas?
 
Dim objConn
objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "DSN=DCTRepair"
objConn.Open()
Dim objRS
objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open("TechEntry", objConn, 2, 3, 2)
objRS.AddNew()
objRS("SerialNumber") = TextBox1.Text
objRS("TechNumber") = TextBox2.Text
'objRS.MoveLast()

objRS.Update()
objRS.MoveFirst()

objConn.Close()
objConn = Nothing
End Sub

The code above works fine till I try to update or use the MoveLast
option for the database. Any ideas?

Stephen, sounds like you don't have modify permissions at the
directory where the database is located, or a database file is read-
only.
 
Back
Top