Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'Move the ADO to the current member record
- Const PATH = "loginTest.mdb"
- Dim connectionAdo As New ADODB.Connection 'create new connection variable
- Dim recordsetAdo As New ADODB.Recordset 'create new recordset variable
- Dim found As Boolean
- 'Dim position As Integer
- 'open connection to database
- connectionAdo.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=SoftwareTrainingLad.mdb;Persist Security Info=False"
- 'use SQL command to get details from user table
- recordsetAdo.Open "SELECT * FROM user" & activity, connectionAdo, , adLockOptimistic
- 'Initialise info from database
- recordsetAdo.MoveFirst
- Do Until recordsetAdo.EOF Or found 'repeat until record found or all file searched
- 'if ID matches current user ...
- If recordsetAdo("username").Value = username Then
- found = True 'set boolean flag to exit loop
- Else
- recordsetAdo.MoveNext 'next record
- End If
- Loop
- If found = True Then
- For position = 1 To 3
- arrayDistance(position) = recordsetAdo.Fields(activity & "Dist" & position).Value
- arrayBPM(position) = recordsetAdo.Fields(activity & "BPM" & position).Value
- Next
- MsgBox ("Called")
- End If
- connectionAdo.Close
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement