Powershell MSAccess Database

I'm creating mini database using Microsoft Access with Powershell v5. what I want to do is to get the data from my text box and save that on msAccess Database.
Also I want to get the data from MS Access database and display that using a graph or any output type..

example table columns that I need.
employee_ID, Username, Password, Role

Appreciate if you can help me figure out the code thanks.
Nher moralesPowerShell BeginnerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

John TsioumprisSoftware & Systems EngineerCommented:
Curious...why use use PS to create Access and what exactly you are after...
Nher moralesPowerShell BeginnerAuthor Commented:
Hi John, thanks for the feedback, actually I'm trying to build a mini username and password project with database where in they have to sign in first before using a tool. I want to have the user to create their own username and password and save it to secure access database.
hoping someone  can help.

user -> create username and password -> save to Ms Access -> able to pull out by power Shell
Thomas UCommented:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Powerful Yet Easy-to-Use Network Monitoring

Identify excessive bandwidth utilization or unexpected application traffic with SolarWinds Bandwidth Analyzer Pack.

Nher moralesPowerShell BeginnerAuthor Commented:
thanks thomas, I will try to look into the link..
I need to get this done and understand the flow of command
John TsioumprisSoftware & Systems EngineerCommented:
wouldn't be better to allow the users to logon to the application as new user...fill the necessary data and you will provide the username/password...probably from the combination of letters of their actual names...
Nher moralesPowerShell BeginnerAuthor Commented:
@John, Yeah! I like your Idea...Sorry I dont know how to put that to codes.. I'm a newbie trying to study powershell

Created simple file: Saving database and it works for me.. But I guess your Idea is way better.

$Db = "sampledb.mdb"
$cursor = 3
$lock = 3

$conn = New-Object -ComObject ADODB.Connection
$recordset = New-Object -ComObject ADODB.Recordset
$conn.Open("Provider=Microsoft.Ace.OLEDB.12.0;Data Source=$Db")

$query = "Select * from LoginInfo"

$recordset.Fields.Item("EmpID") = "1"
$recordset.Fields.Item("UserName") = $username_txt.Text
$recordset.Fields.Item("PWord") = $password_txt.Text
$recordset.Fields.Item("EmpRole") = $userrole_combo.SelectedItem

Nher moralesPowerShell BeginnerAuthor Commented:
thanks guys.. but I still have may things to ask if you dont mind..
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.