Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » db access to MS ACCESS
db access to MS ACCESS [message #16809] Sat, 12 July 2008 15:35 Go to next message
maxmeier is currently offline  maxmeier
Messages: 9
Registered: July 2008
Location: Nürnberg
Promising Member
Hi,

does anyone have a code example (or a link to) how to
- login MS Access
- perform a select stmt to an Access-Table
- performm an update/insert
??

Any tip appreciated!
Thanks in advance

maxmeier

Re: db access to MS ACCESS [message #16810 is a reply to message #16809] Sat, 12 July 2008 18:32 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

These question are not strictly upp related. Please try to find the answers yourself. Net is full of information about MS Access. Inserting/updating/removing in upp is done on low level using sql commands.
Re: db access to MS ACCESS [message #16811 is a reply to message #16810] Sat, 12 July 2008 19:03 Go to previous messageGo to next message
maxmeier is currently offline  maxmeier
Messages: 9
Registered: July 2008
Location: Nürnberg
Promising Member
When I try to connect to MS Access by means of upp, then it is of course strictly upp-related.
The point is, that only sparse documentation exists and sources are scarcely documented.
If you deliver a framework that is such complete different from other ones, you should provide more and better help for beginners.
Upp-Team likes to compare with wxWidgets - you should also compare the bookware!

ciao
maxmeier
Re: db access to MS ACCESS [message #16812 is a reply to message #16811] Sat, 12 July 2008 19:28 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

maxmeier wrote on Sat, 12 July 2008 13:03

When I try to connect to MS Access by means of upp, then it is of course strictly upp-related.
The point is, that only sparse documentation exists and sources are scarcely documented.
If you deliver a framework that is such complete different from other ones, you should provide more and better help for beginners.
Upp-Team likes to compare with wxWidgets - you should also compare the bookware!

ciao
maxmeier

The documentation is a work in progress. As for your questions -did you take a look at references and examples? You'll find there how to open connection, read/write to database. The only difference is you have to replace sqlite/mysql/postgres plugin with oledb and provide proper connection string (this is what I meant you're able to find on net) in oledb Open method. Rest is the same (of course you have to use ms access sql dialect).

PS: Connection string format to ms access: http://www.connectionstrings.com/?carrier=access

PS2: Your code should look like this:
#include <OldDb/OleDb.h>

OleDbSession db;
db.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;User Id=admin;Password=topsecret");
SQL = db;
SQL.Execute("select name from persons");
while(SQL.Fetch())
{
   cout << SQL[0] << "\n";
}

[Updated on: Sat, 12 July 2008 19:45]

Report message to a moderator

Re: db access to MS ACCESS [message #16813 is a reply to message #16812] Sat, 12 July 2008 20:31 Go to previous messageGo to next message
maxmeier is currently offline  maxmeier
Messages: 9
Registered: July 2008
Location: Nürnberg
Promising Member
great, really looks simple.
Connecting to database was not the problem, but I couldn't find out how to come from OleDBSession to "SQL".
Thank you!

bye
maxmeier
Re: db access to MS ACCESS [message #16814 is a reply to message #16813] Sat, 12 July 2008 21:48 Go to previous message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Note that it's not obligatory to use SQL:
Sql(db).Execute("my query");

It's just handy.
Previous Topic: PostgreSQL GetInsertedId()
Next Topic: Difference between INT_ and INT?
Goto Forum:
  


Current Time: Sun Apr 28 21:23:28 CEST 2024

Total time taken to generate the page: 0.07448 seconds