Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

What went wrong - Please advise!

Discussion in 'Information Technology' started by MN, Nov 18, 2005.

Tags:
  1. MN

    MN
    Expand Collapse
    Guest

    Hi,
    I used MS Access 2K, ODBC link to SQL2K Server
    I got an error code Run-time error 3146. It's highlight at ".Update"

    Dim db As Database
    Dim Rs1, Rs2, Rs4 As Recordset
    Set db = CurrentDb
    Set Rs1 = db.OpenRecordset("dbo_case", dbOpenDynaset, dbSeeChanges)
    With Rs1
    If Not IsNull(Me.lname) And Not IsNull(Me.fname) Then
    .AddNew
    !Status = 1
    .Update
    End If
    End With
    If I put a "s" after Recordset(s) I got an error: Data Method not found.
     
  2. Loading...

    Similar Threads Forum Date
    Sects What went wrong with Sikhism? History of Sikhism Aug 16, 2010
    Why Our Punjab Went From Being A State Of Strapping Young Men To Weakened Youth Infested With Drugs Hard Talk Jun 11, 2016
    Spiritual I Went To Church Today Blogs Jan 24, 2016
    We went to Gurdwara for the first time! New to Gurdwara Dec 5, 2014
    World Coffee and Qahwa: A Drink for Arab Mystics that Went Global Breaking News Apr 18, 2013

  3. Brendan Reynolds

    Brendan Reynolds
    Expand Collapse
    Guest

    Probably there are fields other than 'Status' which are required, or there
    are foreign key or other constraints which prevent the saving of the record.

    If you open the table in datasheet view, enter a 1 in the 'Status' field,
    and attempt to save the record, you'll likely get a more informative error
    message which will indicate what the problem is.

    --
    Brendan Reynolds


    "MN" <MN@discussions.microsoft.com> wrote in message
    news:F21F09E9-99AB-472D-B27C-243BA1D68BB5@microsoft.com...
    > Hi,
    > I used MS Access 2K, ODBC link to SQL2K Server
    > I got an error code Run-time error 3146. It's highlight at ".Update"
    >
    > Dim db As Database
    > Dim Rs1, Rs2, Rs4 As Recordset
    > Set db = CurrentDb
    > Set Rs1 = db.OpenRecordset("dbo_case", dbOpenDynaset, dbSeeChanges)
    > With Rs1
    > If Not IsNull(Me.lname) And Not IsNull(Me.fname) Then
    > .AddNew
    > !Status = 1
    > .Update
    > End If
    > End With
    > If I put a "s" after Recordset(s) I got an error: Data Method not found.
     
  4. Douglas J Steele

    Douglas J Steele
    Expand Collapse
    Guest

    In addition to what Brendan said, I'd like to point out that your
    declaration isn't doing what you probably think it is.

    Dim Rs1, Rs2, Rs4 As Recordset

    only declares Rs4 to be a recordset: Rs1 and Rs2 are being declared as
    Variants.

    Since you're using DAO methods, your declaration should be:

    Dim Rs1 As DAO.Recordset, Rs2 As DAO.Recordset, Rs4 As DAO.Recordset


    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no e-mails, please!)


    "MN" <MN@discussions.microsoft.com> wrote in message
    news:F21F09E9-99AB-472D-B27C-243BA1D68BB5@microsoft.com...
    > Hi,
    > I used MS Access 2K, ODBC link to SQL2K Server
    > I got an error code Run-time error 3146. It's highlight at ".Update"
    >
    > Dim db As Database
    > Dim Rs1, Rs2, Rs4 As Recordset
    > Set db = CurrentDb
    > Set Rs1 = db.OpenRecordset("dbo_case", dbOpenDynaset, dbSeeChanges)
    > With Rs1
    > If Not IsNull(Me.lname) And Not IsNull(Me.fname) Then
    > .AddNew
    > !Status = 1
    > .Update
    > End If
    > End With
    > If I put a "s" after Recordset(s) I got an error: Data Method not found.
     

Share This Page