Results 1 to 6 of 6

Thread: Help building an SQL statement

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2000
    Location
    U.S.A.
    Posts
    75

    Cool

    I need help building an SQL statement that includes all the records of a recordset...except the current active record.

    There is no primary key on this database and it is a DBase III database.

    Any suggestions?

  2. #2
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    Is there a field or fields that make the current record unique?

    If so

    select * from table where field1 not='' (and field2 not='';etc)

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2000
    Location
    U.S.A.
    Posts
    75
    Ahhh theres the hitch I am checking what should be a unique field with the rest of the database to insure no dupes.

    My code works when adding new records as the record being saved does not exist yet in the recordset.

    However if editing an existing record this is where I have the problem...

    If someone attempts to save the record without changing the Partnumber it will think there is a dupe as it exists in the recordset.

    If I am able to construct a recordset excluding the current part I will be able to search for dupes.

    Any ideas on a different approach? Or how I could write the SQL statement?

  4. #4
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    And your reason for not defining a primary key and letting the DBMS do all the dirty work for you is?

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Mar 2000
    Location
    U.S.A.
    Posts
    75
    Older Software that has to remain compatable is the reason.

    I was stuck with this DBase III database and I have to live with it...if it were up to me I would use an Access database. But then again I dont get paid to make those decisions.

    *sigh*

  6. #6
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    The older software could still use DBase, you could set up a process that copies the data to an Access database that it doesn't have to know about...

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