Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Adding Blank Fields to DB

CoolWriterCoolWriter Member Posts: 72
[b][red]This message was edited by CoolWriter at 2002-7-31 0:35:19[/red][/b][hr]
Hi,
Is there any way to add balnk fields to a database. When I try to leave a field blank, an exception occours. How can I eliminate this exception and leave the field blank?
Thanls lot...


Comments

  • d faderd fader Member Posts: 247
    : [b][red]This message was edited by CoolWriter at 2002-7-31 0:35:19[/red][/b][hr]
    : Hi,
    : Is there any way to add balnk fields to a database. When I try to leave a field blank, an exception occours. How can I eliminate this exception and leave the field blank?
    : Thanls lot...
    :
    :
    :

    I'm sure this has something to do with the field being a 'NOT NULL' field in the database. If this is the case, it just won't work, since the db will not allow you to post empty value's in it...


    [blue][b][italic],-~[ D-FADER ]~-'[/italic][/b][/blue]

  • CoolWriterCoolWriter Member Posts: 72
    : : Hi,
    : : Is there any way to add balnk fields to a database. When I try to leave a field blank, an exception occours. How can I eliminate this exception and leave the field blank?
    : : Thanls lot...
    : :
    :
    : I'm sure this has something to do with the field being a 'NOT NULL' field in the database. If this is the case, it just won't work, since the db will not allow you to post empty value's in it...

    But there should be a way to post empty values in to db. Need help...
  • DonAlexandroDonAlexandro Member Posts: 32
    [b][red]This message was edited by DonAlexandro at 2002-7-31 8:18:52[/red][/b][hr]
    : : : Hi,
    : : : Is there any way to add balnk fields to a database. When I try to leave a field blank, an exception occours. How can I eliminate this exception and leave the field blank?
    : : : Thanls lot...
    : : :
    : :
    : : I'm sure this has something to do with the field being a 'NOT NULL' field in the database. If this is the case, it just won't work, since the db will not allow you to post empty value's in it...
    :
    : But there should be a way to post empty values in to db. Need help...
    :
    :
    :> Have a look at the property Table.Fields[I].Required!! It arranges whether or not a field is required to be filled.
    :> I think it is the solution to your problem (or maybe not) :-)


  • CoolWriterCoolWriter Member Posts: 72
    : [b][red]This message was edited by DonAlexandro at 2002-7-31 8:18:52[/red][/b][hr]
    : : : : Hi,
    : : : : Is there any way to add balnk fields to a database. When I try to leave a field blank, an exception occours. How can I eliminate this exception and leave the field blank?
    : : : : Thanls lot...
    : : : :
    : : :
    : : : I'm sure this has something to do with the field being a 'NOT NULL' field in the database. If this is the case, it just won't work, since the db will not allow you to post empty value's in it...
    : :
    : : But there should be a way to post empty values in to db. Need help...
    : :
    : :
    : :> Have a look at the property Table.Fields[I].Required!! It arranges whether or not a field is required to be filled.
    : :> I think it is the solution to your problem (or maybe not) :-)
    :
    :
    :

    No it is not about being a requierd field. My problem is just leaving the field blank. How can I leave a field blank with no value?

  • Mark StrijbosMark Strijbos Member Posts: 82

    : No it is not about being a requierd field.
    oh yes it is!

    : My problem is just leaving the field blank.
    : How can I leave a field blank with no value?

    the thing is: a required field cannot be left blank. the database engine will throw the exception if you try to leave a required field blank. same thing applies to fields with a minimum value etc




  • CoolWriterCoolWriter Member Posts: 72
    My field is not a required field. But I still cannot leave the field blank... What should I do?
  • Mark StrijbosMark Strijbos Member Posts: 82
    : My field is not a required field. But I still cannot leave the field blank... What should I do?
    :

    IMHO there is probably another field property spoiling things.
    Does the field have a minimum value? is it tied to a lookup table? part of an index key?

    in any case: the problem must lie within the db or field definition. this is not a Delphi issue, the exception gets thrown by the db engine.
    If it is not too big, you can send the db to me at M.Strijbos@kcl-azn.demon.nl and i'll take a look if i can see what the problem is




  • DonAlexandroDonAlexandro Member Posts: 32
    : : My field is not a required field. But I still cannot leave the field blank... What should I do?
    : :
    :
    : IMHO there is probably another field property spoiling things.
    : Does the field have a minimum value? is it tied to a lookup table? part of an index key?
    :
    :No! It is not one of these features(no minimum value,no index key,no lookup table).The strange think is that when i open a delphi table from
    DBDEMOS the fields that are not claim to be required (at Table.Fields.Required) ARE NOT REQUIRED.If a change this property into 'Required' on run-time (this change is not permanently:is not stored to the table properties) then these fields are become required (but not the opposite).I suppose that the behaviour of the fields depends on 'Table.FieldDefs.Items' property and not from the 'Table.Fields'.But the 'Table.FieldDefs.Items' are Read-only properties! But there would be someway to change not only the properties but also the structure of the table (i.e size of ftString fields,FieldName..) because all the databases that i have used (dbase,access..) can do that! Whatever,if i find something new i'll let you know. :-|
  • Mark StrijbosMark Strijbos Member Posts: 82
    : there would be someway to change not only the properties but also
    : the structure of the table (i.e size of ftString fields,
    : FieldName..) because all the databases that i have used
    : (dbase,access..) can do that!

    mmm... first of all: i would not presume anything on the basis of what other db products offer. And im not convinced that changing field properties at runtime is such a good idea anyway so it would not surprise me if this is somehow blocked by some engines.
    IMHO best practice would be to duplicate the data into another table
    with the new definitions you need and switch tables when needed


  • Justin BibJustin Bib USAMember Posts: 0

    < http://forcoder.org /> free video tutorials and ebooks about ( Java Objective-C PHP JavaScript Scratch Swift C Python R C++ Visual Basic .NET Visual Basic Assembly Delphi PL/SQL MATLAB C# Perl Ruby Go Rust Erlang Lua Lisp Clojure Hack Logo VBScript Fortran Awk LabVIEW Apex FoxPro SAS COBOL Dart Crystal D Prolog ABAP ML Julia Scala Ada Alice Bash Scheme Transact-SQL Kotlin F# )

Sign In or Register to comment.