Hi all:
For full code, see thread707-1576485.
I am populating a listview with the Field Names and properties from an Access DB (2003). I pulled the property part of this code straight from the help file, but it isn't correct. Mainly, I have an Autonumber key field called "ID" that doesn't seem correct.
Here is the portion of the code that adds to Listview and then gets the properties.
This is the Help procedure:
Here are the results for ID:
[code>>Column ID]
ID BASECOLUMNNAME = Attributes: 1 - Type: 202 - Value:
ID BASETABLENAME = Attributes: 1 - Type: 202 - Value:
ID BASECATALOGNAME = Attributes: 1 - Type: 202 - Value:
ID BASESCHEMANAME = Attributes: 1 - Type: 202 - Value:
ID KEYCOLUMN = Attributes: 1 - Type: 11 - Value: False
ID ISAUTOINCREMENT = Attributes: 1 - Type: 11 - Value: False
ID RELATIONCONDITIONS = Attributes: 1 - Type: 204 - Value:
ID CALCULATIONINFO = Attributes: 1 - Type: 204 - Value:
ID OPTIMIZE = Attributes: 1 - Type: 11 - Value: False
[/code]
As you can see, it is an auto-incremented field in the DB, but the code properties show it as false...same with Key.
Am I (or the code) missing something?
Thanks,
Ron Repp
If gray hair is a sign of wisdom, then I'm a genius.
My newest novel: Wooden Warriors
For full code, see thread707-1576485.
I am populating a listview with the Field Names and properties from an Access DB (2003). I pulled the property part of this code straight from the help file, but it isn't correct. Mainly, I have an Autonumber key field called "ID" that doesn't seem correct.
Here is the portion of the code that adds to Listview and then gets the properties.
Code:
While Not FieldsRS.EOF
If FieldsRS.Fields(2) = TV1.SelectedItem.Text Then
Set LI = LV1.ListItems.Add(, , FieldsRS(3), 2, 2)
IntType = GetFieldType(FieldsRS.Fields(2), FieldsRS(3))
LI.SubItems(1) = GetFieldTypes(IntType)
[b][COLOR=blue] FieldOutput FieldsRS.Fields(2), FieldsRS.Fields(3)[/color][/b]
This is the Help procedure:
Code:
Sub FieldOutput(strTemp As String, fldTemp As Field)
' Report function for FieldX.
Dim prpLoop As Property
Debug.Print "Valid Field properties in " & strTemp
' Enumerate Properties collection of passed Field
' object.
For Each prpLoop In fldTemp.Properties
' Some properties are invalid in certain
' contexts (the Value property in the Fields
' collection of a TableDef for example). Any
' attempt to use an invalid property will
' trigger an error.
On Error Resume Next
Debug.Print fldTemp & " " & prpLoop.Name & " = Attributes: " & _
prpLoop.Attributes & " - Type: " & prpLoop.Type & " - Value: " & prpLoop.Value
On Error GoTo 0
Next prpLoop
End Sub
Here are the results for ID:
[code>>Column ID]
ID BASECOLUMNNAME = Attributes: 1 - Type: 202 - Value:
ID BASETABLENAME = Attributes: 1 - Type: 202 - Value:
ID BASECATALOGNAME = Attributes: 1 - Type: 202 - Value:
ID BASESCHEMANAME = Attributes: 1 - Type: 202 - Value:
ID KEYCOLUMN = Attributes: 1 - Type: 11 - Value: False
ID ISAUTOINCREMENT = Attributes: 1 - Type: 11 - Value: False
ID RELATIONCONDITIONS = Attributes: 1 - Type: 204 - Value:
ID CALCULATIONINFO = Attributes: 1 - Type: 204 - Value:
ID OPTIMIZE = Attributes: 1 - Type: 11 - Value: False
[/code]
As you can see, it is an auto-incremented field in the DB, but the code properties show it as false...same with Key.
Am I (or the code) missing something?
Thanks,
Ron Repp
If gray hair is a sign of wisdom, then I'm a genius.
My newest novel: Wooden Warriors