Solved

Access 2013 - Sample DAO code

Posted on 2015-02-19
2
217 Views
Last Modified: 2015-02-22
My OS is win 7 prof 64 bit and i use Access 2013.  i have a small password creating App which works fine without problems.  I now want now to check the created password with those that have been created before, and if a duplicate exists, then to re-generate the password code again, if not, then to append the password to a field in the table.
The name of the table, is tblMainpassword.  The name of field where the old passwords are : strcreatedpwds; and the name of the variable holding the newly created password is : strgeneratedpwd.

Hope the Experts can give me the sample syntax on how to go thru the field in he table one by one to check if it exists or not.  
Thank u.
0
Comment
Question by:jegajothy
2 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 40618952
If DCount("*", "tblMainPassword", "strCreatedpwds='" & strgeneratedpwd & "'") > 0 Then
  MsgBox strgeneratedpwd " & already exists"
Else
  CurrentProject.Connection.Execute "INSERT INTO tblMainPassword(strCreatedPwds) VALUES('" &strGeneratedPwd & "'")
End If
0
 

Author Closing Comment

by:jegajothy
ID: 40624727
thank u.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This is about my first experience with programming Arduino.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

762 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now