CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2003
    Location
    Edinburgh, UK
    Posts
    277

    Default value doesnt work?

    This is a wierd one - maybe I dont understand it (most likely)

    I have 2 tables.

    table 1 has a field of which a default value has been given in the design of the table.

    this works perfect, so if i leave this specific field blank by default, it fills the blank value in as set in the "Default Value"

    cool!



    table 2 has a relationship to table 1 by ID. so table1.ID is the primary key.

    in table 2 there is also another field, and as with table 1 I made a default value for this new field.

    thing is, for some reason its not working. So if i leave this field blank, the "Default Value" will not kick in at all.

    what am I doing wrong?

  2. #2
    Join Date
    May 2004
    Location
    London, England
    Posts
    563

    Re: Default value doesnt work?

    How is your table schema written? Have you actually set a default for this field?

    Regards
    I don't mind that you think slowly but I do mind that you are publishing faster than you think. Wolfgang Pauli, physicist, Nobel laureate (1900-1958)

  3. #3
    Join Date
    Feb 2005
    Location
    "The Capital"
    Posts
    5,306

    Re: Default value doesnt work?

    Please show the db-schema (the create table scripts), the pk-fk relationships and the query that you use to test this functionality.

    It should not happen as long as the relationship is not invalidated! What database server are you using?

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

Featured