473,320 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Run a procedure on multiple rows

Hello,

I have a password management database in which I can scroll through a
list of employees for a specific location. I have a nifty generate
password procedure that we use to change passwords on a monthly basis.

The Problem:
It takes quite awhile to run the procedure on each employee (over
250)and update all the passwords.

The Solution:
I'm looking to you for a method in which I can automatically run the
generate password procedure for each employee at a specified location
or even all locations (update the whole table). Sounds like a job for
FOR/NEXT but my VB prowess has proved unsuccessful. Any ideas? I
appreciate your help!
Nov 13 '05 #1
2 1153
If you have a function that returns a new password then wouldn't executing
SQL something like

UPDATE tblEmployees SET EmployeePassword = fNewPassword()

do the job for you?
Of if perhaps it's based on their last password

UPDATE tblEmployees SET EmployeePassword = fNewPassword([EmployeePassword])

Otherwise yes - you could go loopy (in the for/next sense of course).

hth
--

---------------------------------------------------------------
"Mr. Bungle" <sl********@hotmail.com> wrote in message
news:ab**************************@posting.google.c om...
Hello,

I have a password management database in which I can scroll through a
list of employees for a specific location. I have a nifty generate
password procedure that we use to change passwords on a monthly basis.

The Problem:
It takes quite awhile to run the procedure on each employee (over
250)and update all the passwords.

The Solution:
I'm looking to you for a method in which I can automatically run the
generate password procedure for each employee at a specified location
or even all locations (update the whole table). Sounds like a job for
FOR/NEXT but my VB prowess has proved unsuccessful. Any ideas? I
appreciate your help!

Nov 13 '05 #2
Alright phew! I figured it out...I counted the number of records for
that location and created a FOR/NEXT that called the generatepassword
procedure for each record:

Private Sub UpdateStation_Click()
Dim NoR As Byte
Dim CurrentStation As String

DoCmd.GoToRecord , "UserCodes", acFirst

CurrentStation = Me![StationName]
NoR = DCount("*", "UserCodes", "[StationName] =""" & CurrentStation &
"""") - 1

GeneratePassword_Click ' Update the
current record
Me!Password = Me!RandomPassword
Me!DateUpdated = Now()

For x = 1 To NoR
DoCmd.GoToRecord , "UserCodes", acNext 'Cycle Through
each record
GeneratePassword_Click 'and update the
passwords.
Me!Password = Me!RandomPassword
Me!DateUpdated = Now()
Next
DoCmd.GoToRecord , "UserCodes", acFirst 'Go Back To
Initial Record
End Sub
Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: merdaad | last post by:
I am trying to read multiple rows from an SP into a datalist. I can easily read and display multiple rows if I use a select statement but when I call an SP to send me a few rows, I only get back...
3
by: - | last post by:
I have a country table with code and name columns and create a stored procedure 'get_countries()' but have no idea what is the syntax to return multiple rows. I have searched the newsgroups and...
4
by: Amy | last post by:
Hello, I've been struggling to learn C#.NET for a while now. I've made some progress, but I'm easily stumped. :( What's stumping me today is this: I've got a stored procedure (SQL) that...
2
by: trialproduct2004 | last post by:
Hi all, i am having application which is using stored procedure written in sql server. I want to develop multithreaded applicaton. The store procedure is returing list of rows of table. what i...
3
by: Amy | last post by:
I'm having trouble getting some data into a datagrid. It works fine for the results of the first SELECT in the stored procedure, but not therafter. Here's the error I get: "A field or property...
2
by: Carl San | last post by:
I am using ADO.Net in VB.net application. .Net Framework 1.1. In a stored procedure I have multiple output parameters and multiple result sets. How to code for this in ADO.Net? I have used...
5
by: Wael | last post by:
Hi, I have the following stored procedure that does some processing and puts the result in a temporary table. I tried several things that procedure to display output that I can access with...
1
by: deepdata | last post by:
Hi, I am trying to fetch data from db2 (express version) database by calling stored procedure. I have tried to use both cursor and for loop but still i am getting error. --======Start...
1
by: No bother | last post by:
If I have a procedure that will be run simultaneously by several people which requires the use of a temporary table is there a way for the table to be accessible only in the instance in which the...
4
by: yin_n_yang74 | last post by:
I am new to SQL and SQL Server world. There must be a simple solution to this, but I'm not seeing it. I am trying to create a crystal report (v8.5) using a stored procedure from SQL Server...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.