Searching Records In database using VB as Front end & Access as back end


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Searching Records In database using VB as Front end & Access as back end

  1. #1
    Md Razzak Ali Guest

    Searching Records In database using VB as Front end & Access as back end


    I want a solution regarding how can I fetch the record of an Employee from
    an Employee database by just typing in his/her unique Emp ID.


  2. #2
    Martin Guest

    Re: Searching Records In database using VB as Front end & Access as back end



    I've just worked on something that sounds similiar using a remote data control.
    I basically just used the SQL function. Here is my code, hope it helps.

    Private Sub cmdFind_Click()
    Dim txtparm As Variant
    txtparm = CVar(txtFind.Text)

    datPrimupd.SQL = "Select * " _
    & " From PRODSS.DRUG_OVERPAYMENT " _
    & " Where EMP_ID = '" & txtparm & "'"

    Screen.MousePointer = vbHourglass
    datPrimupd.Refresh
    Screen.MousePointer = vbDefault
    End Sub


    "Md Razzak Ali" <razaq_ali@hotmail.com> wrote:
    >
    >I want a solution regarding how can I fetch the record of an Employee from
    >an Employee database by just typing in his/her unique Emp ID.
    >



  3. #3
    Kevin Guest

    Re: Searching Records In database using VB as Front end & Access as back end


    Just to add to what Martin said.
    If the employee ID is a numeric field then do not include the single quotes
    around the variable.
    datPrimupd.SQL = "Select * " _
    & " From PRODSS.DRUG_OVERPAYMENT " _
    & " Where EMP_ID = " & txtparm

    If it is a string / text value then you must include them as Martin pointed
    out below.

    Kevin

    "Martin" <wmartin@lab.bcbsmt.com> wrote:
    >
    >
    >I've just worked on something that sounds similiar using a remote data control.
    >I basically just used the SQL function. Here is my code, hope it helps.


    >
    >Private Sub cmdFind_Click()
    > Dim txtparm As Variant
    > txtparm = CVar(txtFind.Text)
    >
    >datPrimupd.SQL = "Select * " _
    > & " From PRODSS.DRUG_OVERPAYMENT " _
    > & " Where EMP_ID = '" & txtparm & "'"
    >
    >Screen.MousePointer = vbHourglass
    > datPrimupd.Refresh
    > Screen.MousePointer = vbDefault
    >End Sub
    >
    >
    >"Md Razzak Ali" <razaq_ali@hotmail.com> wrote:
    >>
    >>I want a solution regarding how can I fetch the record of an Employee from
    >>an Employee database by just typing in his/her unique Emp ID.
    >>

    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center