What database type to choose?
-
As a former (and current) UNIX programmer, I am finding myself in a state of confusion when it comes to DB programming in windows. In UNIX I get the libraries I need to talk to the database and use SQL statements to do it all. I connect, query, then parse the results. I'm looking for something as simple to do un Windows. If it helps, I'm looking for something very php (www.php.net) like in syntax: connect(params), execute(sql statement), fetch_array(results), disconnect(). Most important no note that the fetch_array returns tabel data as record=fetch_array(query_result); record[field]="some val". Alternative to that is fetch_row which you can use the index (column number) of the field to get that value. Is there anything like that in Microsoft? Do I have to use classes of CDatabase and CRecordset? It looks like I have to jump through a lot of hoops to get something simple working. Secondly, what are the installation requirements for the particular methods? Must I always require Microsoft Access be installed? Under UNIX I can make such a requirement because there always is a UNIX admin handy to install it. But on a PC I cannot make that assumption. I have to assume that any inexperianced user can handle it. Which also raises the question, how do I initialize a database under windows? Could I use hard coded SQL statements? Thanks in advance
-
As a former (and current) UNIX programmer, I am finding myself in a state of confusion when it comes to DB programming in windows. In UNIX I get the libraries I need to talk to the database and use SQL statements to do it all. I connect, query, then parse the results. I'm looking for something as simple to do un Windows. If it helps, I'm looking for something very php (www.php.net) like in syntax: connect(params), execute(sql statement), fetch_array(results), disconnect(). Most important no note that the fetch_array returns tabel data as record=fetch_array(query_result); record[field]="some val". Alternative to that is fetch_row which you can use the index (column number) of the field to get that value. Is there anything like that in Microsoft? Do I have to use classes of CDatabase and CRecordset? It looks like I have to jump through a lot of hoops to get something simple working. Secondly, what are the installation requirements for the particular methods? Must I always require Microsoft Access be installed? Under UNIX I can make such a requirement because there always is a UNIX admin handy to install it. But on a PC I cannot make that assumption. I have to assume that any inexperianced user can handle it. Which also raises the question, how do I initialize a database under windows? Could I use hard coded SQL statements? Thanks in advance
Take a look at http://download.microsoft.com/download/vc60pro/sample/1/WIN98/EN-US/Adovc1.exe It's a simple sample using the #import directive, which makes it pretty easy to use ADO to do all the stuff you want... Simply include MDAC in your setup's, it can be downloaded from http://www.microsoft.com/data/ All database drivers are included in MDAC, so as long as you are using Access databases or SQL Server, you know the drivers are there... Hope this helps. - Anders