By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,955 Members | 1,756 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,955 IT Pros & Developers. It's quick & easy.

Fetching string

Ali Rizwan
100+
P: 927
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.
Thanxxxxxxxxxxxxxxxxxxxxxxxxx
Sep 4 '07 #1
Share this Question
Share on Google+
4 Replies


QVeen72
Expert 100+
P: 1,445
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 :

Expand|Select|Wrap|Line Numbers
  1. Select '1' As ClsNo, Class1.* From Class1
  2. Union All
  3. Select '2' As ClsNo, Class2.* From Class2
  4. Union All
  5. Select '3' As ClsNo, Class3.* From Class3
  6. Union All
  7. Select '4' As ClsNo, Class4.* From Class4
  8. Union All
  9. Select '5' As ClsNo, Class5.* From Class5
  10.  
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
Sep 4 '07 #2

Ali Rizwan
100+
P: 927
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 :

Expand|Select|Wrap|Line Numbers
  1. Select '1' As ClsNo, Class1.* From Class1
  2. Union All
  3. Select '2' As ClsNo, Class2.* From Class2
  4. Union All
  5. Select '3' As ClsNo, Class3.* From Class3
  6. Union All
  7. Select '4' As ClsNo, Class4.* From Class4
  8. Union All
  9. Select '5' As ClsNo, Class5.* From Class5
  10.  
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
Sep 4 '07 #3

QVeen72
Expert 100+
P: 1,445
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
Sep 4 '07 #4

Ali Rizwan
100+
P: 927
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
Sep 4 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.