Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2003
    Posts
    3

    Unanswered: problems adding records to linked tables

    Hi everyone,

    I just used the upsize wizard in Access to create a Access front end and SQL server 2000 backend with linked tables, but I am receiving an error that I can't figure out.

    When I am trying to add a record into my 'Cases' linked table in the SQL server, I get a error saying: "Invalid object name" with -2147217865 as the error message.

    Here is my code:

    Dim testrecord As ADODB.Recordset
    Dim conn As ADODB.Connection

    Set conn = New ADODB.Connection
    conn.ConnectionString = "Provider=sqloledb.1;" & _
    "DSN=intelitrak;" & _
    "UID=geir;PWD=test"
    conn.Mode = adModeReadWrite
    conn.Open

    Set testrecord = New ADODB.Recordset
    testrecord.Open "Cases", conn, adOpenKeyset, adLockOptimistic,
    adCmdTableDirect ------ the ERROR occurs here!!!

    With testrecord
    .AddNew
    If Forms(stDocName)!NewReopen = "New" Then
    !MasterID = NewID
    IsReOpen = False
    Else

    .....etc.

    I looked all around for an answer, and I partially found a answer at Microsoft's website: http://support.microsoft.com/default...NoWebContent=1

    However, I do not know how to make this work. I tried to create a stored procedure, and test if that made any differance, but it still said it the it was a invalid object.

    Can anyone help me?

    Geir

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Just a shot in the dark...

    What if you add dbo_ to the front of Cases
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Oct 2003
    Posts
    3

    Unhappy still not working

    That was not it.

    I tried to put 'dbo_Cases' in my VBA code, but the same error happens.

    Geir

  4. #4
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Sorry...mayb a post in the VB forum...

    Do you have other code that connects?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  5. #5
    Join Date
    Oct 2003
    Posts
    3
    none of my code that involves adding new records to the database is working. The code that views the records, however, works perfectly.

    Geir

Posting Permissions

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