|
Sirs,
until now I have not used any databases, I just did what any underdeveloped programmer in the stoneage must also have done, namely storing data in house made text files, and reading them from my app.
Now that the future has begun I decided to go with it, and I am spiritually prepared to learn.
But there are so many of abbreviations like ADO, DAO, ODBC, SQL etc. that I am pretty confused which way to go so that I can learn something useful and on the other hand not to have to deal with the whole universe at once.
My data mainly comes from charts, and different engineering databases which rarely have thousands of elements rather less. On the user side I also wanna avoid special requirements, at most MS Office.
Could you please share your ideas as to where to start?
Thank you.
Bunburry
Experience is of no ethical value. It is merely the name men give to their mistakes.(O.Wilde)
|
|
|
|
|
I find ADO to best the best option nowadays. It's very simple to get started with and there are plenty of examples in MSDN and the Platform SDK. ADO is a wrapper for ODBC/OLEDB and is probably the best place to start with databases. It can connect to pretty much any database from Access to SQL to Oracle providing you have the latest version MDAC installed.
The thing I like about ADO is that I can pretty much take the same code from C++ to ASP to Visual Basic without too many headaches.
Michael
|
|
|
|
|
Micheal, i'm developing an MFC app that will use a database for primary storage. What special requirments would ADO have? I need to be able to set the app up relitavely easily on other machines once finished. Also, is it easier to grasp than DAO?
ARGH! My head hurts... too many TLA's.... :
---
"Transmit in all known frequencies and in all known langauges, including Welsh."
|
|
|
|
|
ADO requires MDAC to be installed. This comes with Office but is a simple download from Microsoft. I find ADO easier to use than DAO but I haven't used DAO in 4 years.
I use ADO in MFC apps, using one of the ADO wrapper classes found on CodeProject. Download some of the ADO classes here on CodeProject and compare them to your DAO code.
Michael
|
|
|
|
|
Guys I Used DAO for years, but when I Knew ADO I said GUAU. Is for that I made the ADO Classes equal to DAO Classes, for made easy to use ADO for the programmers that want to learn ADO....
Best Regards....
Chau!!!
Carlos Antollini.
|
|
|
|
|
I too have come from the text file storage area, but i'm working on a project which is going to require large amounts of data (including archived data), so holding everything in arrays is a bit stupid...
I'm currently learning DAO, which is a framework for interfacing with the MS Access engine (called the ket database engine). SQL (Structured Query Language) is the langauge you'll use to query data (try the SQL view in MS access once you've constructed a simple query to view the code). I don't think DAO would suit you much since you siad you want to avoid special requirements - DAO involves setting up a database using MS Access beforehand. ODBC is perhaps the way forward for you.
I'm sure you'll have some helpful replies, i'm not really that experienced with databases as of yet.
---
"Transmit in all known frequencies and in all known langauges, including Welsh."
|
|
|
|
|
The best one to learn is ADO because it allows you to specify the database location at runtime without playing with ODBC. Also, ADOX allows you to create your own databases from scratch.
ADO does tend to bite you in the bum a lot, for example, I found out the hard way that calling MoveFirst() on a recordset with no records crashes pretty damn hard. You might like to search this forum for ADO, I know Hazi and myself have both asked a lot of questions here to get over the initial learning hump and you'll probably save yourself some hassle. Other than that, obviously keep asking questions as you learn.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
Hi,
Well, I recommend you to use ADO, it´s more or less "modern", quite easy to use, and quite powerful, but that´s only to work wit the data, to visualize it you have to use some ActiveX controls ( for example a free on it´s DbGrid that it´s shipped with VStudio).
Here in Codeproject you can find a lot of help on that.
An easier to use thing could be ODBC, but is more or less the same job...
HTH
Braulio
|
|
|
|
|
Hello there,
I have an application called UDPApp (I am trying to write a UDP server) in MFC. Now in the menu I have an option "File>Listen Port" to decide which port the server will listen to for requests.
What I want is that when the user clicks on the menu option Listen Port, he gets a dialog box called ListenBox. (ListenBox is a member variable of the view class UDPAppView).
So I have the following message handler in the UDPAppView.cpp file
void CUDPAppView::OnFileListenport()
{
if (ListenBox.DoModal() == IDOK) {
//Code....
}
}
According to my expectation, whenever the user clicks the menu option "File>Listen Port", the message handling code in UDPAppView.cpp should get executed and I should see the dialog box.
But the problem is that nothing happens when I click File>Listen Port!!!
Help me someone PLEASE!!
Thanks,
Mike
|
|
|
|
|
Is the code at the top of the .cpp and in the .h file to link this function to this message intact ?
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
Hi there ! I am trying to get a start with the WTL .
I am using it in a DLL if that is important I got all compilation issues resolved I also added an
extern CAppModule _Module;
and the local declaration for it in an implementation file
CAppModule _Module
This way I got all unresolved externals resolved, except one, and I just don't know what I need to link to get it away.. this is the error:
error LNK2001: unresolved external symbol __imp___CrtDbgReport
Anybody knows whats going on here ?
|
|
|
|
|
How can I in code to change the picture that appear in my picture control - load another bitmap(IDB_BMP1) from my resources.
|
|
|
|
|
With ::LoadBitmap() or LoadImage() functions
If you are using the CStatic class After that you can use CStatic::SetBitmap(HBITMAP) where HBITMAP is the Handle that you got in one of the first functions...
Best Regards....
Chau!!!
Carlos Antollini.
|
|
|
|
|
|
Don't mention it...
We are for help us!!!!
Best Regards!!!
Chau!!!
Carlos Antollini.
|
|
|
|
|
Carlos, me parece que lo quisistes decir es, "Estamos aqui para ayudarnos", verdad? Si es asi, entonces se dice: "We're here to help each other".
Chao,
Alvaro
|
|
|
|
|
What was it? Spanish? Brazillian? or Cuban?
Sounds interesting though.
// Fazlul
Get RadVC today! Play RAD in VC++
http://www.capitolsoft.com
|
|
|
|
|
Dear Fazul...
It was Spanish, Alvaro was correcting me because my English is not good.
Alvaro: gracias por corregirme, tengo que ponerme al día con mis clases de Ingles.....
Buen Fin de semana.
Good Weekend....
Carlos Antollini.
|
|
|
|
|
Yeah, I could smell that:
corregirme (correction?)
Ingles (English?)
Have a nice weekend.
// Fazlul
Get RadVC today! Play RAD in VC++
http://www.capitolsoft.com
|
|
|
|
|
Very Well!!!
You lern quickly!!!
Have a nice weekend....
Carlos Antollini.
|
|
|
|
|
Hi all,
Q1. What is Initial Catalog in connection string ?
Q2. Please explain about CursorLocation ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Dear Hadi I will answer yur questions.
A1. Initial Catalog is the database in wich you connection will do the pointer.
For example if you Use Initial catalog= db1 over SQL Server your connection will open the db1 database....
A2.CursorLocation: This property allows to select between cursor libraries accessible to the provider.
Usually, you can choose between using a client-side cursor library or one that is located on the server.
Best Regards.....
Chau!!!
Carlos Antollini.
|
|
|
|
|
Hi Mr.Carlos, thanks alot for your answers,
Reply A1:
hmmm, so i must write my database name in Initial Catalog, so what i'll should write in Data Source ?
Can i write only Provider and Data Source in the connection string for connecting to SQL Server database ?
Reply A2:
When my database is Access, then i can use of CursorLocation ?
If my database is SQL Server, then can i use CursorLocation ?
New Q:
What is difference between thease Providers:
SQLOLEDB and MSDASQL ???
New Q:
Question is about CursorType:
When my database is Access, i must use adOpenKeysey instead adOpenDynamic ? why ?
If my database is SQL Server, can i use adOpenDynamic ?
I'm get confuse
Please help me ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Dear Hadi.
let me see...
A to Re:A1: Is true you can write the connection string without the Initial Catalog, but you need to selecting the default database in the ODBC driver configuration.
A to Re:A2: When you use a access databaase you only can use the adUseClient Cursor Location or adUseNone. Obviously, in this case, that you will use the first option...
A to New Q:
I will copy directly from the MSDN the following:
Microsoft OLE DB Provider for SQL Server (SQLOLEDB), which directly maps OLE DB interfaces and methods over SQL Server data sources. Microsoft OLE DB Provider for ODBC (MSDASQL), which maps OLE DB interfaces and methods to ODBC APIs. OLE DB consumers connect to a SQL Server database through an existing SQL Server ODBC driver.
We recommend using SQLOLEDB, supplied with SQL Server, as your OLE DB provider. SQLOLEDB maps OLE DB interfaces and methods over SQL Server data sources without using the ODBC API or the SQL Server ODBC driver as intermediaries.
There are differences between SQLOLEDB and MSDASQL. The two providers support different connection properties, and SQLOLEDB does not support the use of an ODBC DSN connection.
A to new Q2:
The problem is the following. When you use CursorLocation equal to adUseClient the only cursor type for use is adOpenStatic if yiu use another cursor type ado will use open static cursor. When you set adUseServer in your cursor location you can select every cursor type.
Cheers!!!;)
Chau!!!
Carlos Antollini.
|
|
|
|
|
Hi again Mr.Carlos ...
Thanks again for your answer ... your help was useful ...
I got my all answers, only i have theory question about CursorLocation, still:
If i wanna write my program for the Server computer, i must change CursorLocation to adUseServer ?
and
If i wanna write my program for the Client computer, i must change CursorLocation to adUseClient ?
Is it right ?
Is it for all databases ?
With Warm Regards,
Hadi !
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|