Fetching string

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ali Rizwan
    Banned
    Contributor
    • Aug 2007
    • 931

    #1

    Fetching string

    Hi
    I want to do something like this.
    I have an information table which contains all the data about students combined.
    And
    Have information tables per class(1 for one, 2 for two....)
    i want that if we searched for regno 2 then it will search in all class database as well as main database and then update in both. if no record matches in class1 then it search in class 10 and so on.
    And one thing more.
    If i enter somestring like a put into a txtbox then all relative records added to a listbox or a combobox.
    Please tell me how.
    I have to submit my software in couple of days otherwise i lost a big amount, and a customer too.
    Thanxxxxxxxxxxx xxxxxxxxxxxxxx
  • QVeen72
    Recognized Expert Top Contributor
    • Oct 2006
    • 1445

    #2
    Hi,

    Always it is a better Idea, to Save all the Info of all Classes in One Table with a "ClassNo" Field.
    but, anyway, If all the Class Tables have Same Structure , U can Create a "VIEW" (MS SQL/Oracle) and a Query For Access, Some thing like this :

    [code=vb]
    Select '1' As ClsNo, Class1.* From Class1
    Union All
    Select '2' As ClsNo, Class2.* From Class2
    Union All
    Select '3' As ClsNo, Class3.* From Class3
    Union All
    Select '4' As ClsNo, Class4.* From Class4
    Union All
    Select '5' As ClsNo, Class5.* From Class5
    [/code]

    Rename the View/Query as "AllClasses "

    Now, the View is created, It acts as a Virtual Table , U can Query as any normal table:

    say,
    "Select * From AllClasses Where EName ='xyz'"

    Regards
    Veena

    Comment

    • Ali Rizwan
      Banned
      Contributor
      • Aug 2007
      • 931

      #3
      Originally posted by QVeen72
      Hi,

      Always it is a better Idea, to Save all the Info of all Classes in One Table with a "ClassNo" Field.
      but, anyway, If all the Class Tables have Same Structure , U can Create a "VIEW" (MS SQL/Oracle) and a Query For Access, Some thing like this :

      [code=vb]
      Select '1' As ClsNo, Class1.* From Class1
      Union All
      Select '2' As ClsNo, Class2.* From Class2
      Union All
      Select '3' As ClsNo, Class3.* From Class3
      Union All
      Select '4' As ClsNo, Class4.* From Class4
      Union All
      Select '5' As ClsNo, Class5.* From Class5
      [/code]

      Rename the View/Query as "AllClasses "

      Now, the View is created, It acts as a Virtual Table , U can Query as any normal table:

      say,
      "Select * From AllClasses Where EName ='xyz'"

      Regards
      Veena
      Hi thanx for this but i used sql but five years ago and now i have no idea about sql so plz explain this to me. I have done this once but now that is not working.
      I think select * from command used for sql not for access?
      And one thing more i m using controls ADODC and Data Grid control. for viewing data.
      thanxx

      Comment

      • QVeen72
        Recognized Expert Top Contributor
        • Oct 2006
        • 1445

        #4
        Hi,

        "Select * " Can be used for any Database..
        and if it is Access, then Create a Query in Query Designer and Rename, It acts as a Virtual Table..
        Union All means, all the Recs of all the mentioned tables Merger into one sinlge Virtual table

        Regards
        Veena

        Comment

        • Ali Rizwan
          Banned
          Contributor
          • Aug 2007
          • 931

          #5
          Originally posted by QVeen72
          Hi,

          "Select * " Can be used for any Database..
          and if it is Access, then Create a Query in Query Designer and Rename, It acts as a Virtual Table..
          Union All means, all the Recs of all the mentioned tables Merger into one sinlge Virtual table

          Regards
          Veena
          thanx a lot for your explanation Veena.
          And thanx for replying me

          Comment

          Working...