15,888,461 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by KD209 (Top 18 by date)
KD209
21-Sep-18 19:06pm
View
That did the trick!!!!! You are AWESOME! Thanks very much for your time and efforts!
KD209
21-Sep-18 16:27pm
View
Okay, I still get no data even when the script is ran elevated. I also double checked to ensure that the users have data in the PwdAge attribute as well.
KD209
21-Sep-18 14:40pm
View
I am running it as "Run as a different user". I will try from a different machine where my regular account inst an admin so it will prompt for credentials when I run it elevated.
KD209
21-Sep-18 14:37pm
View
Yes.. I am running the PowerShell ISE Console as my domain admin account which is the only account that has access to read/write to AD.
KD209
21-Sep-18 14:21pm
View
That option is not checked for a majority of the users in the output file. All I am trying to do is figure out who has not logged into the system in the last 90 days, and make sure that the accounts that populate are enabled and not set to expire. The password age just helps as a reference as to how long the user may have not been logging in. If you know any other ways to get this outcome I am open.
KD209
21-Sep-18 14:10pm
View
Sorry for the long delay. Yes, there is data established under the PwdAge attribute.
KD209
10-Sep-18 13:18pm
View
Hi Richard,
Thanks for the assist with this. There is no data returning for the PasswordAge or the PasswordLastSet. Is there any other method of retrieving these specific properties?
KD209
16-Nov-17 13:37pm
View
Yes, this is a desktop application.
KD209
15-Jun-17 14:50pm
View
Got it! Thanks for all the help I really appreciate it.
Can you paste the code into the solution field so I can make it as resolved/answered.
KD209
15-Jun-17 14:45pm
View
Richard if you were here right now you would strangle me. I needed to run the query against the "TrackingInfo" table, HAHAHA! It is all working now.
One last question that I have is how to I allow the form to reinitialize instead of doing the me.close()?
KD209
15-Jun-17 14:06pm
View
I figured that would caused me problems. I have corrected that but the code is still giving the error of: "No value given for one or more required parameters" on the line of: "Using fetchreader As OleDbDataReader = cmdfetch.ExecuteReader(CommandBehavior.CloseConnection)"
Also,
The database field/column is a Yes/No field, will the 1 or 0 integers work the same?
KD209
15-Jun-17 13:55pm
View
I am still getting the same exception error:
"System.Data.OleDb.OleDbException was unhandled
ErrorCode=-2147217904
HResult=-2147217904
Message=No value given for one or more required parameters.
Source=Microsoft Access Database Engine
StackTrace:
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(OleDbHResult hr)
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)
at System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior)
at WindowsApplication1.DMNDTracker.CheckOut_Click_1(Object sender, EventArgs e) in C:\Users\KDavis\Documents\Visual Studio 2013\Projects\CheckOutSystem\CheckOutSystem\Form1.vb:line 115
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at WindowsApplication1.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
at System.Activator.CreateInstance(ActivationContext activationContext)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: "
KD209
15-Jun-17 13:41pm
View
When utilizing the Using functions I still run into the error "No value given for one or more required parameters." I'm guessing that query result is still not being captured to run an if statement against.
KD209
15-Jun-17 13:28pm
View
I have rewritten the code, but now I get an error stating that the "ExecuteReader has not been initialized"
Code:
Dim fetchstr As String = connStr
Dim fetchconn As OleDbConnection = New OleDbConnection(fetchstr)
Dim cmdfetch As OleDbCommand = New OleDbCommand()
Dim fetch As String = "Select AssetBarcode from Assets Where AssetBarcode = ? AND CheckedOut = True"
fetchconn.Open()
cmdfetch.Parameters.AddWithValue("AssetBarcode", OleDbType.VarChar).Value = ChkOutBarcode
Dim fetchreader As OleDbDataReader = cmdfetch.ExecuteReader()
While fetchreader.Read()
If ChkOutBarcode.Text = (fetchreader("AssetBarcode")) Then
MessageBox.Show("Item has already been checked out. Please inform the Helpdesk")
Me.Close()
End If
End While
fetchreader.Close()
fetchconn.Close()
KD209
14-Jun-17 14:33pm
View
Here is the code that I have been trying to use to get the desired result:
Dim fetchstr As String = connStr
Dim fetchconn As OleDbConnection = New OleDbConnection(fetchstr)
Dim cmdfetch As OleDbCommand = New OleDbCommand()
Dim fetch As String = "Select AssetBarcode from Assets Where AssetBarcode = ChkOutBarcode AND CheckedOut = True"
'cmdfetch.CommandText = "Select AssetBarcode from Assets Where AssetBarcode = ChkOutBarcode AND CheckedOut = True"
fetchconn.Open()
cmdfetch = New OleDbCommand(fetch, fetchconn)
cmdfetch.Parameters.AddWithValue("AssetBarcode", ChkOutBarcode.Text)
cmdfetch.ExecuteNonQuery()
fetchconn.Close()
If cmdfetch.ExecuteNonQuery > 0 Then
MessageBox.Show("This item has already been checked out. Please alert a Helpdesk team member.")
Me.Close()
End If
KD209
6-Jun-17 11:22am
View
Hi Richard,
Richard provided the solution I was looking for.
KD209
6-Jun-17 11:21am
View
Hi Richard,
I am trying to relearn all of this as it has been 18 years since I have done it last. Thank you for your help! You code does exactly what I was looking for.
KD209
5-Jun-17 12:26pm
View
That did the trick. Thank you, I do not know how I overlook setting the command!
Show More