Hello there, guys!

I'll get right to it. I am coding in VB, using Visual Studio 2005, and I need to retrieve the data from a MS Access database. The thing is, I need to use a SQL statement to do so, right? Therefore, I need to know the number and names of the tables, right? Well, that isn't much of a generic application there, is it...

So, I wanted to ask, is there any way to load the data from the database, without knowing the beforementioned information??? I know it may be a better question under the SQL section, but... be patient...

thanks in advance! Gotta geto to work!

Recommended Answers

All 3 Replies

you can use adodc component to access the data base from the MS Access without using SQL
just goto to the project menu click components or press ctrl + t and tick the microsoft adodc data control 6.0 and drag it to the form then right click on the adodc then adodc properties in the open window choose use connection string then click the Build button next it and in the open window select microsoft ole db 4.0 provider then click Next button now select the ms access database file from which you want to retreive data then click test button REST I WILL TELL WHEN YOU MAIL ME AT neerajraja2001@yahoo.co.in

Yes, thank you, but I already know that. The problem is, in that way I connect to a single database, and I may use only that precise database. What I want to do, instead, is providing the user with the option to connect to a different database every time he uses the program. That is what I mean when I say "generic application".

So, the thing would be, determining the count of the tables in the database, plus the name of every table. I have come up with a solution, which is prompting the user to insert the names of the tables in a text file, which I then use to retrieve the data. I know, it would be the same putting them in a text box in the application window. That way, it is actually possible to include only the desired data, instead of being constrained to load all the data present in the database. So, there is a pro to this method.

The downside is that the user must insert the table names manually... Imagine you have a HUGE database, and you get the meaning... But that's what I've come up with up until now.

So, any help is welcome! Although I really don't think there is a way to retrieve tha data without knowing tha table names. Then again, how does Visual Studio do it??? So, there must be a way!!! Help me sort it out, please!!!

- Shadowhawk

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.