Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2007
    Location
    Ireland
    Posts
    3

    Red face Unanswered: Cannot append to a table in Replica Database..wrong no of values !

    I have created a replica database from a master, but now no append queries will work with either database, i get an error "No. of query values does not match destination fields", I know there are 3 or 4 hidden replica fields added to a table, but these should be added by the system.....but there not. HELP!
    I'm using access 2000.
    Last edited by spiralcomp; 06-07-07 at 12:48.

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Care to share the source of this query (The SQL itself) - this can be accessed by opening the query in design view and switching to SQL view.
    With this could we please have more information about your table - all field names and data types.

    The more information you provide the more chance you give people of helping you
    George
    Home | Blog

  3. #3
    Join Date
    Jun 2007
    Location
    Ireland
    Posts
    3
    Heres the problem in a nutshell.
    I created a new database with one table (Table1) and created a replica database. i.e. Tools-->Replication --> Create Replica

    A table called Table1 with fields fld1(number), fld2(text) ,fld3(text)
    now remember this is a replica database. and heres the query

    insert into table1 values (1,'2','3')

    error
    "number of qurey values and destination fields are not the same"

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    "number of qurey values and destination fields are not the same"
    Code:
    INSERT
    INTO MyTable(Field1, Field2, ... , Fieldn)
    VALUES(1, 2, ... , n)
    Your syntax is incorrect on the INSERT statement - see above.

    Your statement is currently reading: "Stick the values 1, 2 and 3 into table1"
    And SQL is saying: "stick them where? which fields?"
    George
    Home | Blog

  5. #5
    Join Date
    Jun 2007
    Location
    Ireland
    Posts
    3

    That worked

    Thank you for your help, but the statement format i was using woks fine on non-replica databases. I've got a lot of code to update.

    Thanks again for your help.
    Alan

  6. #6
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Well it shouldn't have worked
    As I told a colleague yesterday - SQL is stupid; you have to tell it exactly what you want it to do.

    Your statement read: "Stick the values 1, 2 and 3 into table1"
    And SQL is saying: "Stick them where? which fields?"
    You need to say: "Stick the values 1, 2 and 3 into table1 into Field1, Field2 and Field3 respectively"
    George
    Home | Blog

Posting Permissions

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