.AddNew return Error

Results 1 to 2 of 2

Thread: .AddNew return Error

  1. #1
    Dani Guest

    Default .AddNew return Error

    Connected to an Access Database I cannot update data. It returns:<BR>&#039Could not lock file&#039<BR>I&#039ve tried to change the Recordset options like adLockOptimistic<BR>etc. Nothing has worked so far. I don&#039t necessarely want to use<BR>a SQL Statement! But will if I have to... <BR><BR>Any ideas? Thanks

  2. #2
    Marc Mols Guest

    Default RE: .AddNew return Error

    The following should work. If it doesn&#039t it&#039s not a ASP error.<BR><BR>Set rst = Server.CreateObject("ADODB.Recordset")<BR>rst.Open "tblTable", objConn, 2, 3<BR>rst.AddNew<BR>rst("dtmDate") = Date()<BR>rst("lngObjectID") = lngID<BR>rst("lngUserID") = Session("ID")<BR>rst.Update<BR>rst.Close<BR><BR>Go od luck

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts