Results 1 to 11 of 11

Thread: Access field names and brackets problem [Resolved!]

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950

    Access field names and brackets problem [Resolved!]

    I have an Access db (actually, about 60 of them) that has a table with
    a field named Q#. This table gets read into a dataset. In the dataset,
    the field is also called Q#. But when I try to update the db, an error
    occurs because Access wants the field to be surrounded by brackets -
    [Q#] - when written back. I know this is the problem, because if I
    change the fieldname to QNum, it works fine.
    Using the commandbuilder, or building the INSERT, UPDATE, or DELETE
    manually without brackets, the error is "Syntax error in INSERT
    statement..." (or UPDATE, etc). When I build them manually with
    brackets, the error is "No value given for one or more required
    parameters..."
    An example of the manual statement is: INSERT INTO QS (Q#, QText)
    VALUES(?, ?)
    I don't want to change the fieldname in Access because there are so
    many db's, and the field is used in many queries, forms, etc. I want
    to make all changes to the dataset and update all at once. It works
    using cmd.ExecuteNonQuery, but that's not what I want. Is there a way
    to get this to work? Thanks.
    Last edited by salvelinus; Apr 14th, 2004 at 03:51 PM.

Posting Permissions

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



Click Here to Expand Forum to Full Width