Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi guys,

I'll try to introduce you my task/issue, before my question.

I have an MS-Access database and "some.txt" file containing unique ID's. Those ID's correspond to the ones in my database. This text file is generated from a third party SW. I need to read this file (to get those ID's), connect to the Access database, read out all relevant data from the database, list is into some App, so the user can choose from those options and then export his choice into Excel table.

The Access database holds informations about electrical components. Let's say its a connector, the connector can have different colors, different number of terminals, different terminals etc.

So the txt file contains the ID of the connector and is also stored under this ID in the database. The user opens some app (interface between the database and the file), opens the corresponding txt file. Opening the file will connect to the database, read that Connector with the given ID has 14 Pins, there are three possible colors for the connector and terminals A, B & F can be used with it.

Using the App the users choose color 2, and Terminal F. This will be then printed into some excel woorkbook.

I was thinking to use QT for the App.

Questions:
1) How to connect to the database and read out the informations? I've read about ODBC, OleDB, ADO and other stuff, but honestly I don't understand much, what to use, or why to use it... also the reference in MSDN is quite hard for me at the moment.

2) Is it possible to connect to the database using QT? Everything is know in .NET and I'm not sure, if those two technologies are compatibile or I can mix them up.


I got a pretty solid knowledge of C languace, I'm a beginner in C++ and I understand the very basics of Databases, what is a database and roughly the structure, but no practical experiences.


Can you please give me some advices, which approach I should choose?
Thank you very much for your help and have a nice day!
Vojtech
Posted

1 solution

Sorry, but this is not a "quick answers" kind of question. As you stated, you are beginner. C knowledge is great, but it is just a language, and you need to use now a large set of tools you don't know. I really don't know what help you except from this community. Based on what you wrote, you know your direction, but you lack of knowledge. We can't give you knowledge. You will need to try, learn, struggle, get some experience. If you are stucked in a concrete situation you can ask something that can be aswered.
I can give you one advice: since you speak about .NET, if you want results quickly, you better not struggle with C++ (managed C++ in your case), you better learn C#. You don't have to forget C and C++, as the syntax is from same origin. Might be worth getting a book, but you can also start here: http://www.tutorialspoint.com/csharp/[^]
But there is a big leap between standard C and developing under .NET an application you described.

Of course, you could use QT to do all those you want. But you can do the same in C# with a fracttion of coding compared to QT development of such a task...
 
Share this answer
 
Comments
HellMaster[cz] 15-Jan-15 1:40am    
Hi Zoltan, thank you for your answer. I'll try to rephrase the question:

I've found on the internet, that there are many API's to connect to a database. Which one of them should I use? ODBC, OleDB etc. and why?

I would like to use QT. Is there a better way? I need an interface, thus I'm thinking about QT.

The only thing I need to do is to connect to the database using C/C++ (maybe C#?), read out the values and store them somewhere, so the user can pick one option among the chaos and print it into Excel sheet.
Is it possible to use C or C++?

What are the pitfalls?
Zoltán Zörgő 15-Jan-15 3:38am    
OleDB/ODBC is Microsoft technology, Access is Microsoft technology, Excel is Microsoft technology. C# and .NET is Microsoft technology? Should I emphasize, that this is better combination than doing the same with QT? In .NET you can make GUI in seconds, plus you have all the tools you need. This task can be accomplished in high quality less then 3 hours of coding.

But if you stick to QT, it is your choice:
- you can use ODBC
- you can interoperate wiht Excel

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900