Catennacio
New member
- Local time
- Today, 11:06
- Joined
- Nov 18, 2008
- Messages
- 6
Hi all,
My project requires writing a VBA program to update our customer database structure, including changing the "Allow Zero Length" property of a column and also change Input Mask for that column to "PASSWORD".
I know how to set the "Allow Zero length" property for a column but I have researched everywhere but could not find a way to set the "Input Mask" property for that column.
--------
Here is my code:
Set objDB = CreateObject("ADODB.Connection")
objDB.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & installFolder & "MyDB.mdb;"
Dim cat As Catalog
Dim tbl As Table
Set cat = CreateObject("ADOX.Catalog")
Set cat.ActiveConnection = objDB
Set tbl = cat.Tables("MyTB")
tbl.Columns("Mycol").Properties("Jet OLEDB:Allow Zero Length") = True
tbl.Columns("Mycol").Properties("Input Mask") = "PASSWORD"
Set tbl = Nothing
Set cat = Nothing
objDB.Close
Set objDB = Nothing
--------
The tbl.Columns("Mycol").Properties("Input Mask") = "PASSWORD" does not work when I run the program to update my db.
My question is how to set that column (currently type Text)'s Input mask to "PASSWORD" programmatically?
Any help would be very appreciated!
-Caten
My project requires writing a VBA program to update our customer database structure, including changing the "Allow Zero Length" property of a column and also change Input Mask for that column to "PASSWORD".
I know how to set the "Allow Zero length" property for a column but I have researched everywhere but could not find a way to set the "Input Mask" property for that column.
--------
Here is my code:
Set objDB = CreateObject("ADODB.Connection")
objDB.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & installFolder & "MyDB.mdb;"
Dim cat As Catalog
Dim tbl As Table
Set cat = CreateObject("ADOX.Catalog")
Set cat.ActiveConnection = objDB
Set tbl = cat.Tables("MyTB")
tbl.Columns("Mycol").Properties("Jet OLEDB:Allow Zero Length") = True
tbl.Columns("Mycol").Properties("Input Mask") = "PASSWORD"
Set tbl = Nothing
Set cat = Nothing
objDB.Close
Set objDB = Nothing
--------
The tbl.Columns("Mycol").Properties("Input Mask") = "PASSWORD" does not work when I run the program to update my db.
My question is how to set that column (currently type Text)'s Input mask to "PASSWORD" programmatically?
Any help would be very appreciated!
-Caten