Results 1 to 5 of 5
  1. #1
    adiecidue is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2009
    Posts
    4

    Why isn't this working?

    I have used this type of code many times before, but its simply not working now for some odd reason I can't figure out. I am using Access 2003 with a SQL database. The error I get is ODBC --call failed 3146
    Any help would be appreciated. Here is the code:

    Code:
    Dim rsDxMg As Recordset
    Dim db As database
    Set db = CurrentDb
    Set rsDxMg = db.OpenRecordset("Select * FROM [Exam Info]", dbOpenDynaset, dbSeeChanges)
    With rsDxMg
        .AddNew
        !riop = "100"
        .Update
    End With


  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Maybe:
    Dim rsDxMg As DAO.Recordset
    Dim db As DAO.Database

  3. #3
    thhui is offline Competent Performer
    Windows XP Access 2002 (version 10.0)
    Join Date
    Feb 2009
    Posts
    235
    Check Reference:
    Whether DAO3.6 is selected?

  4. #4
    adiecidue is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2009
    Posts
    4
    Thanks for the replies. Turns out that the table I was trying to add a new row to had a required (non-null) field. As soon as I figured that out and populated that field, it added the row. Funny that it didn't give me an error about that??

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Set rsDxMg = db.OpenRecordset("Select * FROM [Exam Info]", dbFailOnError)

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Query is not working
    By pushpm in forum Programming
    Replies: 3
    Last Post: 04-14-2009, 07:16 PM
  2. Having - Like stops working
    By tdalber in forum Queries
    Replies: 0
    Last Post: 02-03-2009, 04:30 PM
  3. If name = test1 then let , NOT WORKING ?
    By caljohn527 in forum Forms
    Replies: 3
    Last Post: 01-21-2009, 04:01 PM
  4. public instead of dim not working
    By DKY in forum Access
    Replies: 1
    Last Post: 10-14-2008, 11:42 AM
  5. calculated sum not working!
    By Linda Gamble in forum Access
    Replies: 1
    Last Post: 10-12-2007, 06:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums