Members

Technology Zones

Articles

Hosted By

MaximumASP

Info

Accessing a database.

Last post 03-11-2008 6:11 PM by shananne81. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 03-11-2008 6:11 PM

    • shananne81
    • Not Ranked
    • Joined on 03-03-2008
    • United Kingdom
    • New Member
    • Points 100

    Accessing a database.

    Hi,

    Please help, i have this problem

    I have created a database access, and linked via Visual Basic 6. (using ADO), now the problem is, i see every cusomer's details, i only want, from the user's point of view, the user should only be able to see their own details and not every other person's details. How can i go about that?

    Thank you.

    Adodc2.RecordSource = "select * from account02 where C_no= " & Adodc1.Recordset!C_no
    Adodc2.Refresh
    End Sub

    Private Sub Command1_Click()
    current_command = "add"
    Data1.Recordset.AddNew
    End Sub
    Private Sub Command2_Click()
    current_command = "delete"
    End Sub
    Private Sub Command3_Click()
    current_command = "change"
    Data1.Recordset.Edit
    End Sub
    Private Sub Command4_Click()
    On Error GoTo command4_Click_Error
    If current_command = "add" Then
    Data1.Recordset.Update
    End If
    If cuurent_command = "delete" Then
    Data1.Recordset.Delete
    Data1.Recordset.MoveNext
    End If
    If current_command = "change" Then
    Data1.Recordset.Update
    End If
    command4_Click_OK:
    Exit Sub
    command4_Click_Error:
    x$ = "Error " & Err & " " & Error(Err)
    MsgBox x$, 48, "Attempting to " & current_command
    Resume command4_Click_OK
    End Sub
    Private Sub Command5_Click()
    Data1.UpdateControls
    End Sub

    Private Sub Command6_Click()
    On Error GoTo command6_Error
    x = InputBox("Input first few characters of Customer Surname ", "Find on Surname")
    Data1.Recordset.FindFirst "surname like " & "'" & x & "*" & "'"
    command6_OK:
    Exit Sub
    command6_Error:
    y = "Error " & Err & " " & Error(Err)
    MsgBox y, 48, "Find on Surname"
    Resume command6_OK
    End Sub

    • Post Points: 5
Page 1 of 1 (1 items)