|
My old PC has been flagged by MS as incapable of loading Windows updates for 18 months due to its antiquity so I, too, have migrated my old (20+ years) MS-Access apps (which get a lot of use) to a new PC with Office 2019 but the new PC is not yet my main one. As a result of your question, I have checked one of my old apps. For dates, I have Date/Time fields in the underlying tables and display using TextBoxes. I can confirm that even in O2019 there is still a date picker displayed when these fields have focus / are clicked on. You may be able to use the same technique (Date/Time field shown as a TextBox) as an alternative way of selecting dates if you cannot get your ActiveX control to work.
Re other responses: Yes, I did get the memo to move away from MS-Access. But, as a single user, I have never had any problems and follow the "If it ain't broke, don't fix" principle. Plus, I have yet to find any other environment that enables you to have a database, code, forms etc under a single roof that can be changed on the fly if needed. I would like to move off MS-Access as it has only been supported in Pro versions of Office since 2003, but it has served me well since it first came out. Some of my apps have been on MS-Access 1.0 / 1.1 / 2.0 / 97 / 2003 / 2007 / 2016 / 2019 with only minimal changes (even the move from AccessBasic to VBA only really affected a change in the RecordSet class and a few error codes).
|
|
|
|
|
I agree. I use the database for my own project and over the years the numbers of lines of code has grown to an impressive number.
I will give the text box idea a shot. I use the unbound textbox to stop my code from running at a certain time.
|
|
|
|
|
I was able to find the OWC11 installer on the CNET download page. I installed it and it has been working well. I did have to recreate the controls on my forms but at least things are working again.
|
|
|
|
|
Please I am developing a project for boutique and I want to upload pictures of items. I need the code to o that on one single form
|
|
|
|
|
It depends on whether this is a Windows application or a Web application, and where the pictures are stored.
|
|
|
|
|
Well, the only code you're going to get is the core YOU write.
There is no "THE code" to do that. There's a myriad of ways of doing things, but like Richard said, what your options are is going to be dictated by the type of application you're writing.
|
|
|
|
|
Function CheckLogin(ldap as string, usr As String, pwd As String) As Boolean
Dim Success As Boolean = False
Dim Entry As New System.DirectoryServices.DirectoryEntry(ldap, usr, pwd)
Dim Searcher As New System.DirectoryServices.DirectorySearcher(Entry)
Searcher.SearchScope = DirectoryServices.SearchScope.OneLevel
Try
Dim Results As System.DirectoryServices.SearchResult = Searcher.FindOne
Success = Not (Results Is Nothing)
Catch ex As Exception
Success = False
End Try
Return Success
End Function
Hi! I'm having a little trouble with the caret (^) character.
I'm using System.DirectoryServices.DirectoryEntry to verify the AD user.
The problem is when the password has a caret character at the end (E.g. zpfrt^), it returns a FALSE value. Even I tried to enclosed it in [], (), "", and {}, it doesn't solve the problem. I also tried this one - ^^^^, it still not working.
Do you have any idea how to fix this?
If I told the user to change his password without using the caret character, he might say "Windows accept my password with the caret character, why should I change that?" lolz
Please let me know if you have a solution. Thanks in advance guys :)
modified 9-Jul-21 4:01am.
|
|
|
|
|
Solution to what? You haven't shown the code you're using.
|
|
|
|
|
Forgot to post the code, sorry..
|
|
|
|
|
OK, if you're looking to authenticate the credentials provided by the user of your app, it's much simpler to do this:
Imports System.DirectoryServices.AccountManagement
...
Dim isValid As Boolean
Using (pc As PrincipalContext = New PrincipalContext(ContextType.Domain, "YourDomainName"))
isValid = pc.ValidateCredentials("username", "password");
End Using
But, the ^ character is legal in all cases in Active Directory. It doesn't need to be escaped at all.
|
|
|
|
|
Thanks for the reply Dave, your code is simple and great, but it still returns a False value when a caret is on the end of the password.
I forgot to tell - the code is used for a console application. It displays MORE? when I executed it, and I just press ctrl+x to stop the process.
Even if I put four (4) carets, it still returns a False value.
It doesn't produce an error exception, so the code is good..
Can't attach an image here, so I just post a link and see for yourself.
LDAP - Download - 4shared - Uchiha Yueh[^]
But still thanks for the help Dave, I love the simplicity of your code..
|
|
|
|
|
The check will fail if the password is required to be changed or if the password has expired.
Other than that, it's going to be a question for Microsoft.
I don't have an AD setup to test against and there's nothing on the web about the problem of a caret at the end of a password.
Wait, wait, wait. It's been a LONG time, but the caret in a CMD prompt is used by the CMD prompt as an escape character, so it's not really being passed to your code. You can check this by setting a breakpoint on your code to check the credentials and look at the value of 'password' when the breakpoint is hit.
modified 10-Jul-21 11:26am.
|
|
|
|
|
I also don't have an AD setup here at my house.
I'll try it on Wednesday (Phil. Time) at the office and I'll post the result here.
Thanks for your help ^_^
|
|
|
|
|
Dave Kreskowiak wrote: the caret in a CMD prompt is used by the CMD prompt as an escape character But only when typing a command sequence into cmd. Using cin, scanf or similar it is passed direct to the calling application.
|
|
|
|
|
The command line is exactly where he's typing the password, for whatever reason.
|
|
|
|
|
Yes I discovered that after I posted my message to you. But using double quotes round the password fixes it. However, not the best way of doing such an application.
|
|
|
|
|
Agreed. I just told him you would normally never ask for a password on the command line but instead prompt for it after the app launches.
|
|
|
|
|
|
What is the exception that is being thrown? Is that why it is returning false, or is it genuinely the return value?
|
|
|
|
|
The one thing you have not shown us is the actual code that reads the password string.
|
|
|
|
|
Here's the code that Dave has given to me (I changed it a little bit):
Imports System.DirectoryServices.AccountManagement
Module Module1
Sub Main(ByVal args() As String)
Dim isWithAD As Boolean
Try
Dim pc As PrincipalContext = New PrincipalContext(ContextType.Domain, "xx.xx.xx.xx")
Using (pc)
isWithAD = pc.ValidateCredentials(args(0), args(1))
End Using
Console.WriteLine(IIf(isWithAD = True, "Success", "Failed"))
Catch ex As Exception
Console.WriteLine("Error [" + ex.ToString + "] - " + ex.InnerException.ToString)
End Try
End Sub
End Module
The syntax is: CLDAP <username> <password>.
Ex:
CLDAP john_smith 12345
CLDAP "john_smith" "12345"
CLDAP 'john_smith' '12345'
All examples are valid and return a true value. Caret character can be accepted if it is placed in the beginning or in the middle of the password. But, if a caret character is placed at the end of the password, that's where the problem starts
|
|
|
|
|
You just need to put the password in double quotes:
cldap userid "passwd^"
|
|
|
|
|
Normally, you would never type a password on the command line.
You would prompt for it from the application after it's launched. The application can then accept the password without exposing it, replacing characters on screen with some other character or none at all.
|
|
|
|
|
Hi,
I can find the headertext with
Dim lvg As New LVGROUP()
lvg.cbSize = CUInt(Marshal.SizeOf(lvg))
lvg.mask = LVGF_STATE Or LVGF_GROUPID Or LVGF_HEADER Or LVGF_FOOTER
Dim nRetHeader2 As Integer = SendMessage(m.HWnd, LVM_GETGROUPINFO, nItem, lvg)
Dim sHeadText As String = Marshal.PtrToStringUni(lvg.pszHeader)
Dim sFootTxt As String = Marshal.PtrToStringUni(lvg.pszFooter)
however the foottext is always empty.
same for pszDescriptionTop and pszDescriptionBottom
I set the footer with some code I found on the net
Private Shared Sub SetGrpFooter(ByVal lstvwgrp As ListViewGroup, ByVal footer As String)
If Environment.OSVersion.Version.Major < 6 Then Return
If lstvwgrp Is Nothing OrElse lstvwgrp.ListView Is Nothing Then Return
If lstvwgrp.ListView.InvokeRequired Then
lstvwgrp.ListView.Invoke(New CallbackSetGroupString(AddressOf SetGrpFooter), lstvwgrp, footer)
Else
Dim GrpId As System.Nullable(Of Integer) = GetGroupID(lstvwgrp)
Dim group As New LVGROUP
group.CbSize = Marshal.SizeOf(group)
If (footer = String.Empty) Then
group.PszFooter = Nothing
Else
group.PszFooter = footer
End If
'lstvwgrp.HeaderAlignment = HorizontalAlignment.Center
'group.pszDescriptionBottom = "bottom" & Chr(0)
'group.pszDescriptionTop = "top"
<pre>
group.mask = ListViewGroupMask.Footer + ListViewGroupMask.DescriptionBottom + ListViewGroupMask.DescriptionTop
Dim ip As IntPtr = Marshal.AllocHGlobal(group.cbSize)
Marshal.StructureToPtr(group, ip, False)
If GrpId IsNot Nothing Then
group.IGroupId = GrpId.Value
SendMessage(lstvwgrp.ListView.Handle, LVM_SETGROUPINFO, GrpId.Value, ip)
Else
group.iGroupId = GrpId
SendMessage(lstvwgrp.ListView.Handle, LVM_SETGROUPINFO, GrpId.Value, ip)
End If
End If
End Sub</pre>
I also can't find the rectangles of where I have to draw the texts
What do I do wrong?
Jan
|
|
|
|
|
Where are the programmers geniusses from before?
|
|
|
|