471,092 Members | 996 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,092 software developers and data experts.

Connect to DB with Windows App

I am building a windows app, and need to connect to a Microsoft Access
Database. How might I go about doing this? I know sql if that helps any.
I am using Dev C++ and writing in C

Nov 13 '05 #1
3 1403
On Tue, 05 Oct 2004 17:10:24 -0400, "Victorb17" <vi*******@isp.com>
wrote:
I am building a windows app, and need to connect to a Microsoft Access
Database. How might I go about doing this? I know sql if that helps any.
I am using Dev C++ and writing in C

Hi
I have used ODBC. I know this is now deprecated by Microsoft, but so
is the Jet database which I take it is what you want to connect to.
The advantage of ODBC is that you can later swap easily to other dbs
including all the other free ones.
David

Nov 13 '05 #2
I'm not exactly sure how to do that either? if you could post some example
code that would be great. I'm still learning everything and any help is
much appriciated! Thanks!

Nov 13 '05 #3
On Wed, 06 Oct 2004 13:30:27 -0400, "Victorb17" <vi*******@isp.com>
wrote:
I'm not exactly sure how to do that either? if you could post some example
code that would be great. I'm still learning everything and any help is
much appriciated! Thanks!

Hi
Looking back I'm not sure what is the right advice. Originally we used
ODBC via MFC which was fairly straightforward, mainly connecting and
running SQL. Using via ODBC directly, which I did using lcc, is much
more fiddly and I see I only really used SQLExecDirect.

ADO is much less fiddly than ODBC but needs Microsoft
compilers/headers and won't be easy to get working with Dev-C++.

Some databases have their own C API, eg mySQL, which might be easier
to use. Also SQLLite I believe.

There are ODBC examples, on which I based my own code, in MSDN. See
particularly the SQLConnect Function and example, at

http://msdn.microsoft.com/library/de...sqlconnect.asp

the SQLExecDirect Function, and the SQLGetData function and example.
HTH
David
Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Kevin Sage | last post: by
reply views Thread by Jim | last post: by
5 posts views Thread by Kona | last post: by
2 posts views Thread by iwdu15 | last post: by
4 posts views Thread by traceable1 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.