Thread: Re: [Dev-C++] Access databases
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Daniel G. <sp...@ho...> - 2003-05-10 07:04:43
|
Hmm...I know you can use C+ with recordset objects to go through the records, but not sure about Access itself. Try looking at MSDN and do a search on google for "C++"+"Access" or maybe "Database" instead, as you could hook up the MySQL database to it. >From: "Derick van Niekerk" <der...@go...> >To: "DevCPP" <dev...@li...> >Subject: [Dev-C++] Access databases >Date: Fri, 9 May 2003 16:20:39 +0200 > >Anybody know of a quick 'n dirty way to manipulate an access database using >DevCpp? Maybe a lib or a wrapper or something? > >Thanks >-d- _________________________________________________________________ Hotmail messages direct to your mobile phone http://www.msn.co.uk/msnmobile |
|
From: Derick v. N. <der...@go...> - 2003-05-12 06:39:22
|
Thanks. I am sure I'd be able to find an odbc wrapper but I was thinking more along the lines of how M$VC++ is able to access an access database without needing to have the datasources set up under ODBC sources. I am writing a programto read information from scales (as in weighing) into a database. My brother is selling these scales and the company he works for will pay royalties for every scale the program is distributed with. I need to have the program easy to set up becaus their average customer barely knows where to switch on the pc let alone set up ODBC. I was thinking of doing the entire thing in access and I have the database already set up - I just need a small program to handle the task of getting information from the serial port (no problem) and writing it directly into the appropriate table of the access database. Importing and exporting is very messy and I'd rather not do it if I can work around it. Thanks again for all your help guys! -d- ----- Original Message ----- From: "Mark Livingstone" <mli...@ip...> To: <dev...@li...> Sent: Monday, May 12, 2003 5:17 AM Subject: Re: [Dev-C++] Access databases On Fri, 9 May 2003 16:20:39 +0200 "Derick van Niekerk" <der...@go...> wrote: > Anybody know of a quick 'n dirty way to manipulate an access database > using DevCpp? Maybe a lib or a wrapper or something? Well, DevCpp is only a development environment which supports C and C++ programming. If I were you, I'd Google for an ODBC class or wrapper. There are heaps of them out there. I know in times gone by I've seen them mentioned in various projects over at Sourceforge.net. HTH! |
|
From: Yeoh H. <ye...@ye...> - 2003-05-13 00:41:55
|
Hello everyone, Actually you can write a C++ program to access a Microsoft Access database without requiring the user to setup the ODBC DSN. I've written an example program using Dev-C++ 4.9.8.0 (GCC3.2) that reads from a Microsoft Access 2000 database that does not require the user to setup any ODBC DSN. If you like I could e-mail the sample source code to you. :-) Regards, Yeoh ~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~ ICT eBooks by Yeoh HS Free Downloads at http://www.yeohhs.com ~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~ ----- Original Message ----- From: "Derick van Niekerk" <der...@go...> To: "DevCPP" <dev...@li...> Sent: Monday, May 12, 2003 2:38 PM Subject: Re: [Dev-C++] Access databases > Thanks. > > I am sure I'd be able to find an odbc wrapper but I was thinking more along > the lines of how M$VC++ is able to access an access database without needing > to have the datasources set up under ODBC sources. > > I am writing a programto read information from scales (as in weighing) into > a database. My brother is selling these scales and the company he works for > will pay royalties for every scale the program is distributed with. I need > to have the program easy to set up becaus their average customer barely > knows where to switch on the pc let alone set up ODBC. > > I was thinking of doing the entire thing in access and I have the database > already set up - I just need a small program to handle the task of getting > information from the serial port (no problem) and writing it directly into > the appropriate table of the access database. Importing and exporting is > very messy and I'd rather not do it if I can work around it. > > Thanks again for all your help guys! > -d- > > ----- Original Message ----- > From: "Mark Livingstone" <mli...@ip...> > To: <dev...@li...> > Sent: Monday, May 12, 2003 5:17 AM > Subject: Re: [Dev-C++] Access databases > > > On Fri, 9 May 2003 16:20:39 +0200 > "Derick van Niekerk" <der...@go...> wrote: > > > Anybody know of a quick 'n dirty way to manipulate an access database > > using DevCpp? Maybe a lib or a wrapper or something? > > Well, DevCpp is only a development environment which supports C and C++ > programming. If I were you, I'd Google for an ODBC class or wrapper. > There are heaps of them out there. I know in times gone by I've seen > them mentioned in various projects over at Sourceforge.net. > > HTH! > > > > > > ------------------------------------------------------- > Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara > The only event dedicated to issues related to Linux enterprise solutions > www.enterpriselinuxforum.com > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: Mark L. <mli...@ip...> - 2003-05-13 02:10:32
|
On Mon, 12 May 2003 08:38:52 +0200 "Derick van Niekerk" <der...@go...> wrote: > I am sure I'd be able to find an odbc wrapper but I was thinking more > along the lines of how M$VC++ is able to access an access database > without needing to have the datasources set up under ODBC sources. In which case, you are gettin gout of the GPL world and gettin ginto the MS specific world of OLE / COM / ADO + other acronyms :-) > I am writing a programto read information from scales (as in weighing) I suppose it does sound better if not as correct as massing ;-) > into a database. My brother is selling these scales and the company he > works for will pay royalties for every scale the program is > distributed with. I need to have the program easy to set up becaus > their average customer barely knows where to switch on the pc let > alone set up ODBC. > But you are locking yourself fairly tightly into a Windows / Access world. There are zillions of database toolkits, classes, libraries etc. If you need something simple, do you need Access? Can't you build a simple database into your own program? Access doesn't come cheap. Why not have that part of the profit for yourself where possible :-) Lets face it, how many line items are you likely to need to store? A few hundred? > I was thinking of doing the entire thing in access and I have the > database already set up - I just need a small program to handle the > task of getting information from the serial port (no problem) and > writing it directly into the appropriate table of the access database. > Importing and exporting is very messy and I'd rather not do it if I > can work around it. > > Thanks again for all your help guys! NP :-) |
|
From: Derick v. N. <der...@go...> - 2003-05-12 14:43:33
|
Good Idea, but still uses ODBC... I think the messy text export/import might be the way to go for this = project due to the time limitations involved. ODBC is the best thing = since sliced bread, but it is hell to explain to the computer = illiterate. Also I don't know how to install it from within my program. -d- ----- Original Message -----=20 From: iad929=20 To: Derick van Niekerk ; DevCPP=20 Sent: Thursday, May 08, 2003 8:05 PM Subject: Re: [Dev-C++] Access databases If you can understand templates, and you want something portable, why = don't you try Database Template Library? Mohammed ----- Original Message -----=20 From: Derick van Niekerk=20 To: DevCPP=20 Sent: Friday, May 09, 2003 5:20 PM Subject: [Dev-C++] Access databases Anybody know of a quick 'n dirty way to manipulate an access database = using DevCpp? Maybe a lib or a wrapper or something? Thanks -d- |
|
From: Per W. <pw...@ia...> - 2003-05-12 15:10:50
|
When programming with M$ I have used DAO a lot. It doesn't need any ODBC registration to work - it's the native method that Access uses to access the it's databases. Alas, it is using Com, so if you don't find any sample code it's probably too much work. /Per W On Mon, 12 May 2003, Derick van Niekerk wrote: > Good Idea, but still uses ODBC... > > I think the messy text export/import might be the way to go for this project due to the time limitations involved. ODBC is the best thing since sliced bread, but it is hell to explain to the computer illiterate. Also I don't know how to install it from within my program. > > -d- > > ----- Original Message ----- > From: iad929 > To: Derick van Niekerk ; DevCPP > Sent: Thursday, May 08, 2003 8:05 PM > Subject: Re: [Dev-C++] Access databases > > > If you can understand templates, and you want something portable, why don't you try Database Template Library? > > > Mohammed > ----- Original Message ----- > From: Derick van Niekerk > To: DevCPP > Sent: Friday, May 09, 2003 5:20 PM > Subject: [Dev-C++] Access databases > > > Anybody know of a quick 'n dirty way to manipulate an access database using DevCpp? Maybe a lib or a wrapper or something? > > Thanks > -d- |
|
From: Derick v. N. <der...@go...> - 2003-05-13 06:26:06
|
----- Original Message -----=20 From: "Mark Livingstone" <mli...@ip...> To: <dev...@li...> Sent: Tuesday, May 13, 2003 3:50 AM Subject: Re: [Dev-C++] Access databases On Mon, 12 May 2003 08:38:52 +0200 "Derick van Niekerk" <der...@go...> wrote: > I am sure I'd be able to find an odbc wrapper but I was thinking more > along the lines of how M$VC++ is able to access an access database > without needing to have the datasources set up under ODBC sources. In which case, you are gettin gout of the GPL world and gettin ginto the MS specific world of OLE / COM / ADO + other acronyms :-) I figured as much. As I mentioned before there is a time constraint = (about 2 weeks). I already have the database set up, so pulling reports, = issuing queries, input forms and basic transactions are already sorted. = All I need to do is write a small program to read from the serial port = and write into the database. The rest is already done. Rewriting the = program with all the functionallity it has now will take me more than 2 = weeks - espescially if I need to learn a few new libraries. > I am writing a programto read information from scales (as in weighing) I suppose it does sound better if not as correct as massing ;-) Debatable :) > into a database. My brother is selling these scales and the company he > works for will pay royalties for every scale the program is > distributed with. I need to have the program easy to set up becaus > their average customer barely knows where to switch on the pc let > alone set up ODBC. >=20 But you are locking yourself fairly tightly into a Windows / Access world. There are zillions of database toolkits, classes, libraries etc. If you need something simple, do you need Access? Can't you build a simple database into your own program? Access doesn't come cheap. Why not have that part of the profit for yourself where possible :-) Lets face it, how many line items are you likely to need to store? A few hundred? This might be a sollution for version 2 of the program...When I am more = familliar with FLTK (or whatever makes gui easier) and gui development. = This is not something I can become good at overnight! I am very busy = working during the day and most of my free time is swallowed by my = family. I have at most 2 hours a day to do my studies (I am starting my = degree this year- part time), homework and programming. So when I say 2 = weeks, I mean 4-8 hours if I am lucky. Far too little time for a = hobbyist programmer like myself to do a full project! > I was thinking of doing the entire thing in access and I have the > database already set up - I just need a small program to handle the > task of getting information from the serial port (no problem) and > writing it directly into the appropriate table of the access database. > Importing and exporting is very messy and I'd rather not do it if I > can work around it. >=20 > Thanks again for all your help guys! NP :-) |
|
From: Yeoh H. <ye...@ye...> - 2003-05-13 06:52:02
|
To Derick, Sorry, I couldn't send e-mail directly to you as I keep getting this error message. <part extract> The message could not be sent because one of the recipients was rejected by the server. The rejected e-mail address was 'der...@go...'. Subject 'Re: [Dev-C++] Access databases', Server Error: 550, Error Number: 0x800CCC79 </extract> And I think it is not appropriate to send attachments to the group so I've upload the zip file to my site. You can directly download it from this URL: (File Size 11.5KB) http://www.yeohhs.com/shareware/NoDSNCpp-V1.0.zip If you need further help, do e-mail me. Best Regards, Yeoh ~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~ ICT eBooks by Yeoh HS Free Downloads at http://www.yeohhs.com ~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~ ----- Original Message ----- From: Derick van Niekerk To: DevCPP Sent: Tuesday, May 13, 2003 2:25 PM Subject: re: [Dev-C++] Access databases ----- Original Message ----- From: "Mark Livingstone" <mli...@ip...> To: <dev...@li...> Sent: Tuesday, May 13, 2003 3:50 AM Subject: Re: [Dev-C++] Access databases On Mon, 12 May 2003 08:38:52 +0200 "Derick van Niekerk" <der...@go...> wrote: > I am sure I'd be able to find an odbc wrapper but I was thinking more > along the lines of how M$VC++ is able to access an access database > without needing to have the datasources set up under ODBC sources. In which case, you are gettin gout of the GPL world and gettin ginto the MS specific world of OLE / COM / ADO + other acronyms :-) I figured as much. As I mentioned before there is a time constraint (about 2 weeks). I already have the database set up, so pulling reports, issuing queries, input forms and basic transactions are already sorted. All I need to do is write a small program to read from the serial port and write into the database. The rest is already done. Rewriting the program with all the functionallity it has now will take me more than 2 weeks - espescially if I need to learn a few new libraries. > I am writing a programto read information from scales (as in weighing) I suppose it does sound better if not as correct as massing ;-) Debatable :) > into a database. My brother is selling these scales and the company he > works for will pay royalties for every scale the program is > distributed with. I need to have the program easy to set up becaus > their average customer barely knows where to switch on the pc let > alone set up ODBC. > But you are locking yourself fairly tightly into a Windows / Access world. There are zillions of database toolkits, classes, libraries etc. If you need something simple, do you need Access? Can't you build a simple database into your own program? Access doesn't come cheap. Why not have that part of the profit for yourself where possible :-) Lets face it, how many line items are you likely to need to store? A few hundred? This might be a sollution for version 2 of the program...When I am more familliar with FLTK (or whatever makes gui easier) and gui development. This is not something I can become good at overnight! I am very busy working during the day and most of my free time is swallowed by my family. I have at most 2 hours a day to do my studies (I am starting my degree this year- part time), homework and programming. So when I say 2 weeks, I mean 4-8 hours if I am lucky. Far too little time for a hobbyist programmer like myself to do a full project! > I was thinking of doing the entire thing in access and I have the > database already set up - I just need a small program to handle the > task of getting information from the serial port (no problem) and > writing it directly into the appropriate table of the access database. > Importing and exporting is very messy and I'd rather not do it if I > can work around it. > > Thanks again for all your help guys! NP :-) |
|
From: Derick v. N. <der...@go...> - 2003-05-13 08:14:44
|
Yep - that code might do the trick. You might need to explain those SQL headers though along with some of the functions (GlobalLock, GlobalAlloc...actually almost every function you used is new to me. I'd understand If you don't have the time (I know all about that!), but I would appreciate it if you could explain the first half of your program - the initialization... This was EXACTLY what I was looking for. Thanks. -d- ----- Original Message ----- From: "Yeoh HS" <ye...@ye...> To: "DevCPP" <dev...@li...> Sent: Tuesday, May 13, 2003 8:48 AM Subject: Re: [Dev-C++] Access databases To Derick, Sorry, I couldn't send e-mail directly to you as I keep getting this error message. <part extract> The message could not be sent because one of the recipients was rejected by the server. The rejected e-mail address was 'der...@go...'. Subject 'Re: [Dev-C++] Access databases', Server Error: 550, Error Number: 0x800CCC79 </extract> And I think it is not appropriate to send attachments to the group so I've upload the zip file to my site. You can directly download it from this URL: (File Size 11.5KB) http://www.yeohhs.com/shareware/NoDSNCpp-V1.0.zip If you need further help, do e-mail me. Best Regards, Yeoh ~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~ ICT eBooks by Yeoh HS Free Downloads at http://www.yeohhs.com ~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~ |
|
From: Per W. <pw...@ia...> - 2003-05-13 09:16:22
|
GlobalAlloc is like malloc() but it allocates memory directly from Windows. It has a number of tricks, like placing the memory block in first MB of memory etc. GlobalLoc() tells Windows that it may not move or swap out the memory block. This allows safe communication between multiple programs, or direct memory access (DMA) transfers to/from hardware without the processor being involved. For a good reference to SQL functions, you might go to: http://odbcrouter.com/api/SQLExecDirect.shtml and look. /Per W On Tue, 13 May 2003, Derick van Niekerk wrote: > Yep - that code might do the trick. You might need to explain those SQL > headers though along with some of the functions (GlobalLock, > GlobalAlloc...actually almost every function you used is new to me. I'd > understand If you don't have the time (I know all about that!), but I would > appreciate it if you could explain the first half of your program - the > initialization... > > This was EXACTLY what I was looking for. > > Thanks. > -d- > > > > > ----- Original Message ----- > From: "Yeoh HS" <ye...@ye...> > To: "DevCPP" <dev...@li...> > Sent: Tuesday, May 13, 2003 8:48 AM > Subject: Re: [Dev-C++] Access databases > > > To Derick, > > Sorry, I couldn't send e-mail directly to you as I keep getting this error > message. > <part extract> > The message could not be sent because one of the recipients was rejected by > the server. The rejected e-mail address was 'der...@go...'. > Subject 'Re: [Dev-C++] Access databases', Server Error: 550, Error Number: > 0x800CCC79 > </extract> > > And I think it is not appropriate to send attachments to the group so I've > upload the zip file to my site. > You can directly download it from this URL: (File Size 11.5KB) > http://www.yeohhs.com/shareware/NoDSNCpp-V1.0.zip > > If you need further help, do e-mail me. > > Best Regards, > Yeoh > ~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~ > ICT eBooks by Yeoh HS > Free Downloads at http://www.yeohhs.com > ~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~ > > > > ------------------------------------------------------- > Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara > The only event dedicated to issues related to Linux enterprise solutions > www.enterpriselinuxforum.com > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Yeoh H. <ye...@ye...> - 2003-05-13 10:45:37
|
Hi Derick, I'm glad to help. :-) And, you're right. I'm in the middle of a project right now so I don't have much time. :-( But I can point you to a URL for more information. Iczelion's Win32 Assembly Homepage has, IMHO, very good ODBC tutorials. Although the code is in asm, his explanations on ODBC basic programming approach, the API functions to call, the relevant function parameter values, return values and in what order to call those API functions are _very_ clearly explained. Compared to MSDN, this is better and more concise. :-) The five relevant topics covered are: 1. ODBC Basics 2. Connecting to Data Source 3. Preparing and Using Statements 4. Retrieving Results 5. An ODBC Example The URL is: http://win32asm.cjb.net/ in the Tutorials section. For a tutorial in C using Visual C++, here's a URL I found sometime ago. http://www.cxd3.com/tut/cpp/odbc/odbc.html Many thanks to opcodevoid for providing this tutorial for free. The C++ example program I wrote using Dev-C++ is based on his tutorial example. Best Regards, Yeoh ~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~ ICT eBooks by Yeoh HS Free Downloads at http://www.yeohhs.com ~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~ ----- Original Message ----- From: "Derick van Niekerk" <der...@go...> To: "DevCPP" <dev...@li...> Sent: Tuesday, May 13, 2003 4:14 PM Subject: Re: [Dev-C++] Access databases > Yep - that code might do the trick. You might need to explain those SQL > headers though along with some of the functions (GlobalLock, > GlobalAlloc...actually almost every function you used is new to me. I'd > understand If you don't have the time (I know all about that!), but I would > appreciate it if you could explain the first half of your program - the > initialization... > > This was EXACTLY what I was looking for. > > Thanks. > -d- > |