Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Indexed(Yes Duplicates OK) VB+DAO+Access

Posted on 2003-03-01
3
Medium Priority
?
358 Views
Last Modified: 2008-02-01
FieldName        FieldValues     FieldSize

EmpName          text          16
EmpNUmber     text          8
Address          memo
Date          date
IndexNum     AutoNumber


I want set the Indexed(Yes Duplicates Ok) to the Field like(EmpName).How can i do this progrmming through VB with DAO.

If any one knows please help me.


Thsi is my code

Private Sub AppendTable()


set db = DBEngine.OpenDataBase("test.mdb")
Set tbf = db.TableDefs("employee")
'MsgBox tbf.Name
With tbf
   .Fields.Append .CreateField(empname, strText)
   '.Fields.Append .CreateField("strField", dbLong)
   .Fields.Refresh
End With

Set tbf = Nothing
Set db = Nothing
MsgBox "Successfully Added the Table"


End Sub

thanks
Uma T
0
Comment
Question by:umaakce
2 Comments
 
LVL 7

Accepted Solution

by:
fluglash earned 150 total points
ID: 8047362
place on the form data contorol...and then i advice you to use DDL statements Create Table and Create Index (look for syntax in MSDN)

i think it`s more functional
0
 

Expert Comment

by:CleanupPing
ID: 9447427
umaakce:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
Six Sigma Control Plans
Screencast - Getting to Know the Pipeline

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question