C++ and MySQL through ODBC

C++ and MySQL through ODBC

am 23.01.2008 02:11:21 von Alex List

Hello everyone,

I'm building a system for my school to make administration easier on
the staff there and I need to get a C++ command line program to run
ODBC and connect to an MySQL database, retrieve data and and submit
data (updates alters and inserts).

I have the ODBC driver for MySQL implemented and I have it connecting
to my SQL host but only using the test function of the ODBC admin.

What I need is an example program, something with a lot of comments
and explanations in it, that can access a MySQL database (connect) run
SQL insert and select commands (returning to strings) and be just in a
simple interface. (preferably in Visual (studio or C) format and in
one big file)

I have spent upwards of 20 (unsuccessful) hours trying to get it to
work by myself before coming for help so I'm sure others are having
the same issues. I hope that you will take the time to solve this.
I've probably tried to follow the tutorials and wrappers that you can
point me to. I'm probably just dumb for not understanding, but I want
to understand a learn how to do this.

I thought I had a baseline knowledge of programming in c++ until I
had to take this on.

Thank you so, so much.

-Alex

Running:
Windows XP SP2
Visual Studio 2005
ODBC with host on local network EX: (192.168.1.5)
newest Visual C express as of 2008

Oh, and if you need more info, please let me know!

--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: http://lists.mysql.com/myodbc?unsub=gcdmo-myodbc@m.gmane.org

Re: C++ and MySQL through ODBC

am 23.01.2008 14:45:27 von Imran Abizar

Dear Alex,

Here are a few tips:

* Refer to "Inside ODBC", a book from Microsoft Press that has plenty of
examples in C
* Try searching for source code in websites like Krugle.com

Question: Why do you want to write a custom program in C++. Isn't C# or
VB much easier and faster to code. Besides, you won't need to message
with low level C API.

Regards,
Imran.


Alex List wrote:
> Hello everyone,
>
> I'm building a system for my school to make administration easier on
> the staff there and I need to get a C++ command line program to run
> ODBC and connect to an MySQL database, retrieve data and and submit
> data (updates alters and inserts).
>
> I have the ODBC driver for MySQL implemented and I have it connecting
> to my SQL host but only using the test function of the ODBC admin.
>
> What I need is an example program, something with a lot of comments
> and explanations in it, that can access a MySQL database (connect) run
> SQL insert and select commands (returning to strings) and be just in a
> simple interface. (preferably in Visual (studio or C) format and in
> one big file)
>
> I have spent upwards of 20 (unsuccessful) hours trying to get it to
> work by myself before coming for help so I'm sure others are having
> the same issues. I hope that you will take the time to solve this.
> I've probably tried to follow the tutorials and wrappers that you can
> point me to. I'm probably just dumb for not understanding, but I want
> to understand a learn how to do this.
>
> I thought I had a baseline knowledge of programming in c++ until I
> had to take this on.
>
> Thank you so, so much.
>
> -Alex
>
> Running:
> Windows XP SP2
> Visual Studio 2005
> ODBC with host on local network EX: (192.168.1.5)
> newest Visual C express as of 2008
>
> Oh, and if you need more info, please let me know!
>

--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: http://lists.mysql.com/myodbc?unsub=gcdmo-myodbc@m.gmane.org

Re: C++ and MySQL through ODBC

am 23.01.2008 20:18:28 von don-mysql8y

Imran Abizar writes:

> Question: Why do you want to write a custom program in C++. Isn't C# or
> VB much easier and faster to code. Besides, you won't need to message
> with low level C API.

Even if you want to write a C++ program, why not let it do the
database work by calling out to the mysql command line client program?
(That's the program named "mysql" that comes with mysql.)

> > I'm building a system for my school to make administration easier on
> > the staff there and I need to get a C++ command line program to run
> > ODBC and connect to an MySQL database, retrieve data and and submit
> > data (updates alters and inserts).

--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: http://lists.mysql.com/myodbc?unsub=gcdmo-myodbc@m.gmane.org