1. lcLngErrLevel indicates what?why u have used this field
Well this is just a variable that will tell me exactly where did the
error occur.(In our case, its the duplication error although there`s
a wiser way to do that...).

2. after these statements it is giving the error

On Error GoTo ErrHandler
Set lcObjConn = New ADODB.Connection
lcStrConnString = "Provider=Micorsoft.Jet.OLEDB.3.51;Data Source=c:\winnt\inventory.mdb;Persist Security Info=False"

lcObjConn.Open lcStrConnString


the error is "ado could not find the specific provider"
can u tell me what is wrong in that
use this one:
VB Code:
  1. lcStrConnString = "Provider=Microsoft.Jet.OLEDB.4.0;" _
  2.                   & "Data Source=c:\winnt\inventory.mdb;" _
  3.                   & "User Id=Admin;Password=;"

its specific for ADO and although you are using Access 97, I
guess, you can use OLEDB 4.0 instead of 3.51

try this one:

VB Code:
  1. Private Sub SaveRecords()
  2.  
  3.   Dim lcLngi        As Long
  4.   Dim lcStrSQL      As String
  5.   Dim lcFlgUpdate   As Boolean
  6.   Dim lcLngErrLevel As Long
  7.   Dim lcObjConn     As ADODB.Connection
  8.   Dim lcStrConnString As String
  9.  
  10.   On Error GoTo ErrHandler
  11.  
  12.   Set lcObjConn = New ADODB.Connection
  13.   lcStrConnString = "Provider=Microsoft.Jet.OLEDB.4.0;" _
  14.                   & "Data Source=c:\winnt\inventory.mdb;" _
  15.                   & "User Id=Admin;Password=;"
  16.  
  17.   lcObjConn.Open lcStrConnString
  18.  
  19.   With MSFlexGrid1
  20.    
  21.     lcLngErrLevel = 1000
  22.    
  23.     For lcLngi = 1 To .Rows '* Or maybe its (Rows - 1)...
  24.          
  25.       lcStrSQL = "INSERT INTO Document(Folder, FileNo, Name) " _
  26.                 & "VALUES('" & .TextMatrix(lcLngi, 1) & "','" _
  27.                 & .TextMatrix(lcLngi, 2) & "','" _
  28.                 & .TextMatrix(lcLngi, 3) & "')"
  29.                      
  30.       lcLngErrLevel = 1100
  31.       '* Execute SQL statement using an ADO Connection
  32.       lcObjConn.Execute lcStrSQL
  33.       lcLngErrLevel = 1200
  34.      
  35.       If lcFlgUpdate Then
  36.         lcLngErrLevel = 1300
  37.         lcStrSQL = "UPDATE Document " _
  38.                  & "SET Folder = '" & .TextMatrix(lcLngi, 1) & "', '" _
  39.                  & "Name = '" & .TextMatrix(lcLngi, 2) & "' " _
  40.          & "FileNo = '" & .TextMatrix(lcLngi, 3) & "'"
  41.                  & "WHERE [insert yout Primary Key Fieldname here] = '" & .TextMatrix(lcLngi, 0) & "'" '* Replace with your primary key here!
  42.                  
  43.         '* Execute SQL statement using an ADO Connection
  44.         lcObjConn.Execute lcStrSQL
  45.         lcLngErrLevel = 1400
  46.       End If
  47.      
  48.     Next
  49.    
  50.   End With
  51.  
  52.   Set lcObjConn = Nothing
  53.  
  54.   Exit Sub
  55.  
  56. ErrHandler:
  57.  
  58.   If lcLngErrLevel = 1100 Then
  59.     lcFlgUpdate = True
  60.     Resume Next
  61.   Else
  62.     Set lcObjConn = Nothing
  63.     MsgBox Err.Number & ": " & Err.Description
  64.   End If
  65.  
  66. End Sub


Your are most welcomed...let me know how it goes