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

    Write always into same rset.... (2000)

    i want to write alway into same recordset (the first i n table) , i ma not sure for this code, because for each run the code append the value after the last rset...

    Sub TEST_DATE_TAB(DATA_TAB, LOG_MATRICOLA)

    Dim FOGLIO As String
    FOGLIO = "DATE"

    Dim CN As ADODB.Connection, RS As ADODB.Recordset, R As Long, n As Long
    Set CN = New ADODB.Connection
    CN.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & gPROVADatabasePath2
    Set RS = New ADODB.Recordset

    RS.Open "" & FOGLIO & "", CN, adOpenKeyset, adLockOptimistic, adCmdTableDirect

    With RS

    .AddNew
    RS(0) = LOG_MATRICOLA
    RS(1) = DATA_TAB
    .Update

    End With

    RS.Close
    Set RS = Nothing
    CN.Close
    Set CN = Nothing

    FOGLIO = Empty

    End Sub

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

    Re: Write always into same rset.... (2000)

    .AddNew, as the name implicates, adds a new record. If you want to edit the first record of the recordset, simply omit the line .AddNew.

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

    Re: Write always into same rset.... (2000)

    i am stupid, tks.

Posting Permissions

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