-
WSNight
AskWoody LoungerActually I alread have a trap like that. Here is my code
Private m_recLogin As ADODB.Recordset
Private mcnn As ADODB.ConnectionPrivate Const UPDATE_CANCELLED As Long = -2147217842
Private Const ERRORS_OCCURRED As Long = -2147217887Private Sub cmdOK_Click()
‘Validate Passwords
‘Makes sure the password in both boxes are the same
If txtPassword2.Text = txtPassword1.Text Then
MoveToRecord (adDoAddNew)
Else
MsgBox “Invalid Password.”, vbExclamation + vbOKOnly
txtPassword1.SetFocus
End IfEnd Sub
Private Sub Form_Load()
Set m_recLogin = datLogin.Recordset
Set mcnn = m_recLogin.ActiveConnectionEnd Sub
Private Sub MoveToRecord(intDirection As String)
On Error GoTo MoveToRecord_Err
Select Case intDirection
‘Adds User name and Password to Database
Case adDoAddNew
m_recLogin.AddNew “SOID”, txtAliasEnd Select
MoveToRecord_Exit:
frmTotals.Show
Exit SubMoveToRecord_Err:
If mcnn.Errors.Count > 0 Then
For Each errCurrent In mcnn.Errors
MsgBox errCurrent.Number & “–” & _
errCurrent.Description
Next errCurrent
mcnn.Errors.Clear
Else
Select Case Err.Number
Case UPDATE_CANCELLED, ERRORS_OCCURRED
‘Do Nothing
Case Else
Err.Raise Err.Number, Err.Source, Err.Description
End Select
End If
Resume MoveToRecord_ExitEnd Sub
I assume what I did with the errCurrent is what you are talking about.
-
WSNight
AskWoody LoungerJuly 27, 2001 at 12:31 pm in reply to: Error: Argument not Optional (MS Visual Studio-Enterprise) #534945Thanks for sending that example, I will take a look at it, and store it for future need. But I actually got it to write to the database yesturday afternoon. I do appreciate the help you’ve been giving though.
-
WSNight
AskWoody LoungerJuly 26, 2001 at 1:05 pm in reply to: Error: Argument not Optional (MS Visual Studio-Enterprise) #534778I must be. Even when I take out all the code, and have it so just the ADO control is bound to the text boxes i want it won’t update the database. I will take a look at that article and see if it helps out. Thanks for the help.
-
WSNight
AskWoody LoungerJuly 24, 2001 at 5:12 pm in reply to: Error: Argument not Optional (MS Visual Studio-Enterprise) #534482My lock type is adLockOptimistic. I don’t really know if that code worked because it didn’t spit any errors at me. This thing is giving me a brain tumor. I’ve used so many sorces to try and figure out how to use this control, and get it to write to the database. Wish I new more about this stuff than I do.
-
WSNight
AskWoody LoungerJuly 24, 2001 at 1:59 pm in reply to: Error: Argument not Optional (MS Visual Studio-Enterprise) #534451yes, datLogin.Recordset is the recordset attached to the ADODataControl. Right now I am using an adOpenDynamic cursor setting. How do I go about testing the errors collection of the connection?
-
WSNight
AskWoody LoungerJuly 24, 2001 at 1:18 pm in reply to: Error: Argument not Optional (MS Visual Studio-Enterprise) #534439I am using an ADO recordset. Here is my code for the ADO recordset.
Private Sub Form_Load()
Set m_recLogin = datLogin.Recordset
End Sub
Private Sub MoveToRecord(intDirection As Integer)
On Error GoTo MoveToRecord_Err
Select Case intDirection
‘Adds User name and Password to Database
Case adRsnAddNew
m_recLogin.AddNewEnd Select
MoveToRecord_Exit:
frmTotals.Show
Exit SubMoveToRecord_Err:
Select Case Err.Number
Case UPDATE_CANCELLED, ERRORS_OCCURRED
‘Do Nothing
Case Else
Err.Raise Err.Number, Err.Source, Err.Description
End Select
Resume MoveToRecord_ExitEnd Sub
-
WSNight
AskWoody LoungerJuly 24, 2001 at 12:05 pm in reply to: Error: Argument not Optional (MS Visual Studio-Enterprise) #534429I get no error what so ever now. It runs through the code without a hitch. It just doesn’t write it to the target table, or any other table. I’ve done some of my own research (as much as one can anyway) and I think in my adRsnAddNew Case I need to list the fields from the table there. Only thing is I’ve tried doing that a number of ways. I can’t figure out how I’m supposed to do it. Thanks for any help provided.
-
WSNight
AskWoody LoungerJuly 23, 2001 at 2:12 pm in reply to: Error: Argument not Optional (MS Visual Studio-Enterprise) #534306I changed it to a long, string, whatever trying to get this thing to write to the database. I tried update, but it didn’t seem to work. I’m not exactly sure why it won’t save to the database, as far as I know it should work.
-
WSNight
AskWoody LoungerJuly 20, 2001 at 5:11 pm in reply to: Error: Argument not Optional (MS Visual Studio-Enterprise) #534031OK. I actually just figured all the validation out, thanks for the help anway though. Now my only problem is that it is not writing to the database. Here is what I have for code now.
Private Sub cmdOK_Click()
If txtPassword2.Text = txtPassword1.Text Then
MoveToRecord (adRsnAddNew)
Else
MsgBox “Invalid Password.”, vbExclamation + vbOKOnly
txtPassword1.SetFocus
End IfEnd Sub
Private Sub Form_Load()
Set m_recLogin = datLogin.Recordset
End Sub
Private Sub MoveToRecord(intDirection As Integer)
On Error GoTo MoveToRecord_Err
Select Case intDirection
Case adRsnAddNew
m_recLogin.AddNew
m_recLogin(“SOID”) = txtAlias
m_recLogin(“Password”) = txtPassword2End Select
MoveToRecord_Exit:
frmTotals.Show
Exit SubMoveToRecord_Err:
Select Case Err.Number
Case UPDATE_CANCELLED, ERRORS_OCCURRED
‘Do Nothing
Case Else
Err.Raise Err.Number, Err.Source, Err.Description
End Select
Resume MoveToRecord_ExitEnd Sub
I think my problem lies in the part of my Case statement. I am not sure why it isn’t writing to the database though.
-
WSNight
AskWoody LoungerJuly 20, 2001 at 4:52 pm in reply to: Error: Argument not Optional (MS Visual Studio-Enterprise) #534027Yes I am
-
WSNight
AskWoody LoungerJuly 20, 2001 at 4:40 pm in reply to: Error: Argument not Optional (MS Visual Studio-Enterprise) #534022Not to sure on how to use the validate function. Is it possible for you to post some sample code so I could work out how to use it for what I’m doing?
-
WSNight
AskWoody LoungerJuly 20, 2001 at 3:03 pm in reply to: Error: Argument not Optional (MS Visual Studio-Enterprise) #533996I got most of it all figured out. I can do the validation either way. Except with the bound text box it is a little different. To validate it the way I’m doing it on the cmdOk_Click function I needed to add (0) at the end of the txtPassword2 to get the options I needed. I will look into doing it the other way. As for the MoveToRecord, I just forgot to call the case that I wanted so that was easy. It now reads
MoveToRecord(adRsnAddNew)
Thanks for your help. -
WSNight
AskWoody LoungerJuly 20, 2001 at 2:19 pm in reply to: Error: Argument not Optional (MS Visual Studio-Enterprise) #533981Ok I got the first error fixed, but I get the same error on the MoveToRecord part of my code. MoveToRecord is just the name of a subroutine, this should call it should it not? Here is my new code.
Private Sub cmdOK_Click()
If Forms!frmNewUser.txtPassword2.Value Forms!frmNewUser.txtPassword1.Value Then
MsgBox “Invalid Password Entered.”, vbExclamation + vbOKOnly
Forms!frmNewUser.txtPassword1.SetFocus
ElseIf Forms!frmNewUser.txtPassword2.Value = Forms!frmNewUser.txtPassword1.Value Then
MoveToRecordEnd Sub
-
WSNight
AskWoody LoungerJuly 19, 2001 at 12:39 pm in reply to: VBScript – Setting New User Password (MSVisual Studio 6.0, Access 2K) #533752I’ll try that out to see how it works. Thanks for your help. I assume that it is generally the same kind of thing for the user name as well. As for the security with the table holding the passwords. The database itself will not be accessed by anyone except the admin, they will also have restricted permissions as well. Anyway thanks for your help.
-
WSNight
AskWoody LoungerJuly 19, 2001 at 12:35 pm in reply to: Setting User Name and Password via VB (MSVisual Studio 6.0, Access 2K) #533751Well I am using VB mostly. The reason I need to have user names added is because there is potential for more users to be added. And as I said I am new to all of VB, I only started learning it probably 1 week ago when I recieved this project. So I’m not exactly sure how to do much, I’ve used whatever resources I could fine, books, help file, whatever I can. So help on anything would be most useful. I can figure the logic behind all of it since I do have experiance in other programming languages. Thanks.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Where’s the cache today?
by
Up2you2
3 hours, 22 minutes ago -
Ascension says recent data breach affects over 430,000 patients
by
Nibbled To Death By Ducks
6 hours, 24 minutes ago -
Nintendo Switch 2 has a remote killing switch
by
Alex5723
6 hours, 45 minutes ago -
Blocking Search (on task bar) from going to web
by
HenryW
11 hours, 25 minutes ago -
Windows 10: Microsoft 365 Apps will be supported up to Oct. 10 2028
by
Alex5723
16 hours, 32 minutes ago -
Add or Remove “Ask Copilot” Context Menu in Windows 11 and 10
by
Alex5723
16 hours, 39 minutes ago -
regarding april update and may update
by
heybengbeng
18 hours, 8 minutes ago -
MS Passkey
by
pmruzicka
1 hour, 28 minutes ago -
Can’t make Opera my default browser
by
bmeacham
1 day, 1 hour ago -
*Some settings are managed by your organization
by
rlowe44
12 hours, 32 minutes ago -
Formatting of “Forward”ed e-mails
by
Scott Mills
1 day ago -
SmartSwitch PC Updates will only be supported through the MS Store Going Forward
by
PL1
1 day, 20 hours ago -
CISA warns of hackers targeting critical oil infrastructure
by
Nibbled To Death By Ducks
2 days, 5 hours ago -
AI slop
by
Susan Bradley
19 hours, 30 minutes ago -
Chrome : Using AI with Enhanced Protection mode
by
Alex5723
2 days, 6 hours ago -
Two blank icons
by
CR2
18 hours, 26 minutes ago -
Documents, Pictures, Desktop on OneDrive in Windows 11
by
ThePhoenix
2 days, 15 hours ago -
End of 10
by
Alex5723
2 days, 18 hours ago -
Single account cannot access printer’s automatic duplex functionality
by
Bruce
1 day, 16 hours ago -
test post
by
gtd12345
3 days ago -
Privacy and the Real ID
by
Susan Bradley
2 days, 14 hours ago -
MS-DEFCON 2: Deferring that upgrade
by
Susan Bradley
16 hours, 45 minutes ago -
Cant log on to oldergeeks.Com
by
WSJonharnew
3 days, 4 hours ago -
Upgrading from Win 10
by
WSjcgc50
1 day, 16 hours ago -
USB webcam / microphone missing after KB5050009 update
by
WSlloydkuhnle
1 day, 19 hours ago -
TeleMessage, a modified Signal clone used by US government has been hacked
by
Alex5723
3 days, 20 hours ago -
The story of Windows Longhorn
by
Cybertooth
3 days, 8 hours ago -
Red x next to folder on OneDrive iPadOS
by
dmt_3904
3 days, 22 hours ago -
Are manuals extinct?
by
Susan Bradley
22 hours, 37 minutes ago -
Canonical ditching Sudo for Rust Sudo -rs starting with Ubuntu
by
Alex5723
4 days, 7 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.