CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Attribute

  1. #1
    Join Date
    Feb 2001
    Posts
    10

    Attribute

    hi all
    can any one tell me how to find the attribute of a column retrived from a database.I have tried with the following code.It works perfectly with all the enumvalues such as adFldIsNullable,adFldFixed etc. but not with adFldKeyColumn...can any one can help me out please??
    the code is as follows

    *********************************************
    For Each field In rs1.Fields
    If CBool(field.Attributes And adFldKeyColumn) Then
    MsgBox ("Primary Key")
    End If
    Next field
    *************************************
    regards
    shijufrancis


  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Attribute

    Here the example how to change properties

    Dim FlatCat As New ADOX.Catalog

    FlatCat.ActiveConnection = _
    "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=c:\data\juveniledata.mdb;"

    Set objNewColumn = New ADOX.Column
    objNewColumn.Name = "Additional Information"
    objNewColumn.Attributes = adColFixed And Not adColNullable
    objNewColumn.Type = adVarWChar
    objNewColumn.DefinedSize = 30
    objNewTable.Columns.Append objNewColumn
    objNewColumn.Properties("Jet OLEDB:Allow Zero Length").Value = True
    objNewColumn.Properties("Jet OLEDB: Allow Zero Length").Value = True
    objNewColumn.Properties("Default").Value = """"""


    I think to get atributes you can get as
    msgbox(objNewColumn.Attributes)

    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  3. #3
    Join Date
    Feb 2001
    Posts
    10

    Re: Attribute

    hi Iouri
    firstly thanks for the help..
    i think u didnt got my problem....
    what i need is to check the attribute of a column that has retrived from the database..
    this checking is working finely with almost all the enum values except the enum checking for the primary key....thats my problem...
    i think that u r now clear with my prob
    once again thanks
    regards
    shiju


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