Hello.
I'm writting an VB.Net application that creates an ADOX table in an Access MDB.
The field declarations are dynamic. That is to say, the user determines what the field type should be.
The selection comes from a drop down.
my code is something like this:
Problem: I'd like to find a way to convert a string declaration of a field type into an actual enumerated field type.
I'm wondering if there is short cut to the following solution:
Thanks in advance
- mongril
I'm writting an VB.Net application that creates an ADOX table in an Access MDB.
The field declarations are dynamic. That is to say, the user determines what the field type should be.
The selection comes from a drop down.
my code is something like this:
Code:
Dim dr as datarow
for each dr in ds.Tables("Field_Definitions").rows
objColumn = New ADOX.Column
With ObjColumn
.Name = dr.Item("Field_Name")
.Type = dr.Item("Field_Type")
End With
next
Problem: I'd like to find a way to convert a string declaration of a field type into an actual enumerated field type.
I'm wondering if there is short cut to the following solution:
Code:
Dim dr as datarow
for each dr in ds.Tables("Field_Definitions").rows
objColumn = New ADOX.Column
With ObjColumn
.Name = dr.Item("Field_Name")
Select Case dr.Item("Field_Type")
Case "adVarWChar"
.Type = DataTypeEnum.adVarWChar
Case "adInteger"
.Type = DataTypeEnum.adSmallInt
Case "adDate"
.Type = DataTypeEnum.adDate
End Select
.Type = dr.Item("Field_Type")
End With
next
Thanks in advance
- mongril