473,503 Members | 1,647 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how can I create a vbscript to check for capital letter in names

4 New Member
I also need to check that the password has upper, lower, number, and character. Please help I need to do this script for my scripting class. this is only the second part of the script and I'm getting frustrated trying to get it to work. Please help

Expand|Select|Wrap|Line Numbers
  1. dim MyString, MyArray, i, objRegEx
  2. MyString = Inputbox("please tell me your first name, last name, and password")
  3. MyArray = Split (MyString, ",", -1, 1)
  4. Msgbox (MyArray(i))
  5.  
  6. Private Sub cmdChekPWD_Click()
  7. Dim bytFlag 
  8. Dim intI 
  9. Dim strC 
  10. If Len(txtPassword.Text) >= 8 Then
  11.     For intI = 1 To Len(txtPassword.Text)
  12. strC = Mid(txtPassword.Text, intI, 1)
  13.         If strC >= "!" And strC <= "\" Then
  14.             bytFlag = bytFlag Or &H8
  15.         End If
  16.         If strC >= "0" And strC <= "9" Then
  17.             bytFlag = bytFlag Or &H4
  18.         End If
  19.         If strC >= ":" And strC <= "@" Then
  20.             bytFlag = bytFlag Or &H8
  21.         End If
  22.         If strC >= "A" And strC <= "Z" Then
  23.             bytFlag = bytFlag Or &H2
  24.         End If
  25.         If strC >= "a" And strC <= "z" Then
  26.             bytFlag = bytFlag Or &H1
  27.         End If
  28.    Next
  29.  
  30. End If
  31. If bytFlag <> &HF Then
  32.     MsgBox "Invalid Password"
  33.     Else
  34.     if bytflag = &HF then
  35.     msgbox "Valid password"
  36. End If
  37. end if
  38. End Sub
Mar 23 '14 #1
4 2232
Luuk
1,047 Recognized Expert Top Contributor
-- post 1 --
Your homework does not state that you have to use the functions that your will find when Google-ing for 'vbscript uppper lower' ?

Try to write the script, give the code here, and ask the question again if it is not working the way you want it to work.

hint: if your Google skills fail, try to search for 'Lcase' of 'Ucase'

---post 2 ---
now the question is missing, and you should use [CODE/] tags for your code.......

The function cmdChekPWD_Click() does seem to do what you want it to do. A password with a small letter, a captial letter, a number and a special character seems to get the MsgBox "Valid Password"

Can you give more details about your problem?

BTW:
Expand|Select|Wrap|Line Numbers
  1. If bytFlag <> &HF Then
  2. MsgBox "Invalid Password"
  3. Else
  4.  
This is the else so bytFlag is always equal to &HF here! (no need to check that
Expand|Select|Wrap|Line Numbers
  1. if bytflag = &HF then
  2. msgbox "Valid password"
  3. End If
  4. end if
  5.  
Mar 23 '14 #2
charlottewebb63
4 New Member
ok thanks i do not get a msgbox showing up why?
Mar 24 '14 #3
Luuk
1,047 Recognized Expert Top Contributor
I hope you do know how to debug your own code?
Mar 26 '14 #4
charlottewebb63
4 New Member
thanks for the help.
Mar 28 '14 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

7
4794
by: Barry | last post by:
Hi all, I've noticed a strange error on my website. When I print a capital letter P with a dot above, using & #7766; it appears correctly, but when I use P& #0775 it doesn't. The following...
1
2645
by: Marc Verdonck | last post by:
First: I have some troubles in access, some fields needs to begin with a Capital letter. Example: louiselaan need to be Louiselaan. How can I become this? Second: I'm exporting my database to...
2
2346
by: roadworrier | last post by:
I'm trying to create a new object to use as an associative array automatically. I can programmatically create new variables like this: for (var i; i < 10; i++) { window; window = "moo" +...
8
12420
by: =?gb2312?B?yMvR1MLkyNXKx8zs0cSjrM37vKvM7NHEsru8+7z | last post by:
I lookup the utf-8 form of delta from the link. http://www.fileformat.info/info/unicode/char/0394/index.htm and then I want to print it in the python ( I work under windows) #!/usr/bin/python...
5
2727
by: Moham12345 | last post by:
How can i detect if there is more then capital letter in a word?
1
2503
by: mujunshan | last post by:
Yesterday, I installed PythonCE on my cellphone whose OS is Windows Mobile 5.I wanted to use numpy as calculation tool.But after I copy numpy module in my desktop computer into my phone,I find many...
4
5537
by: zcabeli | last post by:
Hi all, i'm currently struggling to perform the above mentioned replacement. i already know how to catch the first letter in each word and determined if it's regular or capital. however, i...
6
3806
emandel
by: emandel | last post by:
OK I am an amateur and your patience is appreciated. I have a database of Donors with their donations. I want to create a button (macro <?>)on my donation form that will automatically open a...
1
2237
by: Tinker Bell | last post by:
Hi Guys, I am new to access and I am trying to create a report in letter format so when I in the form I can select the hyperlink to open report and select which contacts I want to send this...
0
7194
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7070
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7267
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7316
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6976
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5566
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1495
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.