Click to See Complete Forum and Search --> : Attribute


shijufrancis
April 24th, 2001, 02:43 PM
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

Iouri
April 24th, 2001, 03:38 PM
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
iouri@hotsheet.com

shijufrancis
April 24th, 2001, 04:27 PM
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