|
|
Subject:
VB6 - creating a database. How to set a field to have a Password input mask?
Category: Computers > Programming Asked by: trevor92-ga List Price: $10.00 |
Posted:
16 Feb 2004 12:36 PST
Expires: 17 Feb 2004 23:09 PST Question ID: 307380 |
I'm writing a program that creates an Access database from scratch using DAO 3.6 If I create a table in Access, I can select a field, choose 'Input Mask' and select 'Password' from the list provided. I'd like to do this using VB. The VB code snippet I'm using to create the field is: f1.Name = "MyPassword" f1.Type = dbText f1.Size = 25 newTD1.Fields.Append f1 What I'd like is the VB code to replicate the Access Input Mask = Password part of things. I hope this is just one more line of code. I realise that this isn't the most secure way of doing things but it keeps the password away from prying eyes, at least in the first instance, so it's good enough for me... | |
| |
|
|
There is no answer at this time. |
|
Subject:
Re: VB6 - creating a database. How to set a field to have a Password input mask?
From: irishpheremone-ga on 17 Feb 2004 01:40 PST |
trev- You have to add the table then create the property "InputMask"... Heres an example that worked for me: Private Sub Form_Load() ' Locals { Dim dbs As DAO.Database Dim tdf As DAO.TableDef Dim fld As DAO.Field Dim prp As DAO.Property ' } ' New database Set dbs = DBEngine.Workspaces(0).CreateDatabase("C:\temp\temp.mdb", dbLangGeneral) ' New table Set tdf = dbs.CreateTableDef("temp") ' New field Set fld = tdf.CreateField("field1", dbText, 50) ' New property Set prp = fld.CreateProperty("InputMask", dbText, "Password", True) ' Add field Call tdf.Fields.Append(fld) ' Add table Call dbs.TableDefs.Append(tdf) ' Add property (have to do it after table is added!) Call fld.Properties.Append(prp) ' Close Call dbs.Close End Sub |
Subject:
Re: VB6 - creating a database. How to set a field to have a Password input mask?
From: trevor92-ga on 17 Feb 2004 06:06 PST |
Thanks! That works a treat... Trevor P.S. How do I pay you?! |
Subject:
Re: VB6 - creating a database. How to set a field to have a Password input mask?
From: irishpheremone-ga on 17 Feb 2004 17:47 PST |
trev- I am a newbie too... Thought I'd make $10! But it doesn't look like it - I'd suggest cancelling your question before your charged for it... If I figure out how to become an answerer - I'll let you know and, maybe, you can get me later! -Casey |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |