473,654 Members | 3,066 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 2237
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_Clic k() 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
4804
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 capital letters all work correctly - B C D F G M S T with the diacritical marker &#_0775. Why am I having a problem with P?
1
2668
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 outlook. Than some names begin with a capital letter some don't. The name is always in capital letters in access and in outlook sometimes it's capital sometimes not.
2
2358
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" + i; } // now I have foo0,foo1, foo2, foo3... foo9
8
12453
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 #coding=utf-8 print "\xce\x94"
5
2739
by: Moham12345 | last post by:
How can i detect if there is more then capital letter in a word?
1
2515
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 file names in directory \numpy were changed into capital letters.For example: __init__.py was chaged into __INIT__.PY However PythonCE is sensitive to capital directory or filenames. So it is boring to convert those file names to into...
4
5563
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 don't know how to replace this letter with it's corresponding capital letter. perhaps there is an option to change the ascii value of the a character in perl regexp ? for example :
6
3815
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 document in MS Word that will thank the donor for that specific donation. So this is something that I will do as the donation comes in. one donation in, one letter sent. The key is that I don't want a new query (e.g. query all donations in the past week)...
1
2253
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 particular letter to using a filter. All seems to be going ok, however I cant sus out how to get it to reduce the size of Title and Surname fields so I dont get a huge gap between them IE) Mr Bloggs would like it to read Mr Blogs Would...
0
8380
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8296
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8710
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8497
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5627
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2721
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 we have to send another system
2
1928
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1598
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.