Results 1 to 12 of 12
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Error 3021 (2000 sr -1)

    I have used this code to insert in mdb access 756.897 records!
    Now today have error 3021!!!!!!!!!!!


    With RSD1

    RSD1.AddNew

    .Fields("COPE") = COPE
    .Fields("COPLIST") = COPLIST
    '.Fields("NDG") = Format(RSD.Fields("NDG"), "#000000000")
    .Fields("APPELLATIVO") = DESCR
    .Fields("NOMINATIVO") = Replace((NOMINATIVO), ",", " E")
    .Fields("CCIAA") = CCIAA

    If Not DT_NASCITA = "" Then
    .Fields("DT NASCITA") = DT_NASCITA
    End If

    .Fields("LUOGO NASCITA") = LUOGO_NASCITA
    .Fields("PR NASCITA") = PR_NASCITA
    .Fields("SESSO") = SESSO
    .Fields("RESIDENZA") = RESIDENZA
    .Fields("CAP RESIDENZA") = CAP_RESIDENZA
    .Fields("LUOGO RESIDENZA") = LUOGO_RESIDENZA
    .Fields("PR RESIDENZA") = PR_RESIDENZA
    .Fields("CF") = CF
    .Fields("DOMICILIO") = DOMICILIO
    .Fields("CAP DOMICILIO") = CAP_DOMICILIO
    .Fields("LUOGO DOMICILIO") = LUOGO_DOMICILIO
    .Fields("PR DOMICILIO") = PR_DOMICILIO
    .Fields("DOMICILIO IDEM") = DOMICILIO_IDEM
    .Fields("DATA CENSIMENTO") = DATA_CENSIMENTO
    .Fields("DIP CENSIMENTO") = DIP_CENSIMENTO
    .Fields("NOTE - 1") = NOTE_1
    .Fields("NOTE - 2") = NOTE_2
    .Fields("DATA AGGIORNAMENTO") = DATA_AGGIORNAMENTO

    If Not ULT_AGG = "" Then
    .Fields("ULT AGG") = ULT_AGG
    End If

    .Fields("AG ULT AGG") = AG_ULT_AGG

    If SETTORE = "" Then
    MsgBox ("SETTORE VUOTO")
    End If

    .Fields("SETTORE") = SETTORE
    '.Fields("PROVA27") = Range("AA" & R).Value
    '.Fields("PROVA28") = Range("AB" & R).Value
    '.Fields("PROVA29") = Range("AC" & R).Value
    '.Fields("PROVA30") = Range("AD" & R).Value
    .Update

    RIGA = RIGA + 1
    CONTA_RECORD1 = CONTA_RECORD1 + 1

    End With

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Error 3021 (2000 sr -1)

    On which line does the error occur?

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Error 3021 (2000 sr -1)

    .update

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Error 3021 (2000 sr -1)

    Is RSD1 a recordset based on one table or on more than one table?

  5. #5
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Error 3021 (2000 sr -1)

    No, is refered only for one table....

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Error 3021 (2000 sr -1)

    Does this table have a relationship with another table?

    It might help if you attached a stripped-down copy of the database with only a few records - see <post#=401925>post 401925</post#> for instructions.

  7. #7
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Error 3021 (2000 sr -1)

    What does error 3021 mean?

    Aa an aside is there any reason to use .Fields here, why not use RSD1 instead of .Fields, eg:
    RDS1("COPE") = COPE

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Error 3021 (2000 sr -1)

    You can find the error message for an error number by using the AccessError function. Type the following in the Immediate window in the Visual Basic Editor:

    ? AccessError(3021)

    and press Enter. The message is "No current record".

  9. #9
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Error 3021 (2000 sr -1)

    paraphs the part of error is here?:
    Set DB2 = DBEngine.OpenDatabase("CL259F4500MAXTORAPPLICAZION IAPPELLATIVI.MDB")
    Set RSD2 = DB2.OpenRecordset("APP")
    Set DB1 = DBEngine.OpenDatabase("GCD01F4500DATIPUBBLICAAPPLI CAZIONIANAGRAFICA.mdb")
    Set RSD1 = DB1.OpenRecordset("SELECT COUNT(*) FROM ANAGRAFICA1")
    CONTA_RECORD1 = RSD1.Fields(0).Value
    RSD1.Close
    Set RSD1 = DB1.OpenRecordset("ANAGRAFICA1")
    Set RSD3 = DB1.OpenRecordset("COPE_NON_TROVATO_1")
    RSD1.Index = "COPE"

    CONTA_RECORD = RSD3.RecordCount

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Error 3021 (2000 sr -1)

    Sorry, no idea.

  11. #11
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Error 3021 (2000 sr -1)

    thanks Hans, handy to know how to get the description of an error

  12. #12
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Error 3021 (2000 sr -1)

    as Hans has suggested, show us your database

Posting Permissions

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