Solved

Connect to a mysql database

Posted on 2003-11-16
26
849 Views
Last Modified: 2010-04-17
I'm gonna makea client that connect to a mysql database and retrieve informations. I don't need to write in it. I'm gonna make this in visual studio net, using visual c. I need the script that connect to database. Can anyone post an example or give me some tutorial links ?
0
Comment
Question by:-Mihai-
  • 13
  • 10
  • +1
26 Comments
 
LVL 10

Expert Comment

by:D_M_D
ID: 9759396
0
 
LVL 16

Expert Comment

by:_nn_
ID: 9759410
0
 
LVL 9

Expert Comment

by:bhagyesht
ID: 9761732
use ODBC driver for mysql then  use CDatabase and CRecordset.

ODBC driver can be downloaded from the Mysql site
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

Author Comment

by:-Mihai-
ID: 9762267
I will do the program in visual .net . will be a windows application.
i know about mysql++ but i found only a version for visual c++ 6.0 and its full with bugs.
I need something simple but fast and stable. I'm gonna make a client like yahoo messenger that connect to a site database and retrive new News, articles and downloads.

So any better way ?
0
 
LVL 9

Expert Comment

by:bhagyesht
ID: 9762335
-Mihai-: fire a http request from your page to a server. let that server contain the Mysql connection maybe ASP or PHP. and the response of that http should be ur data. this is much better compared to opening the database from n number of places directly
0
 

Author Comment

by:-Mihai-
ID: 9762367
and how should i do that ?
0
 
LVL 9

Expert Comment

by:bhagyesht
ID: 9762435
u can use an activex control inet to achieve this
some example at
http://www.optimus.lt/pages/produktai/05/Online/development/cd_activex_inetget.htm
0
 

Author Comment

by:-Mihai-
ID: 9770944
hmm. lets see that i want my program to connect to www.gamespot.com and to tell me the last 3 pc game news and the last 3 pc screenshots. anyone can help me with an example ?
0
 
LVL 9

Expert Comment

by:bhagyesht
ID: 9776288
what are the html pages which contain that information?
0
 
LVL 9

Expert Comment

by:bhagyesht
ID: 9776296
you can embed inet control in ur vc applicationa and call the openurl method this will return you the complete HTML of that page. Parse it and get ur information
0
 

Author Comment

by:-Mihai-
ID: 9778477
Can you give me some examples and/or tutorial links?
0
 
LVL 9

Expert Comment

by:bhagyesht
ID: 9778568
0
 
LVL 9

Expert Comment

by:bhagyesht
ID: 9778576
or search in google for inet sample download you will get lots of links
0
 

Author Comment

by:-Mihai-
ID: 9779489
i really can't find something usefull ..
0
 
LVL 9

Expert Comment

by:bhagyesht
ID: 9808485
in vc add internet transfer control on a dialog. run the class wizard to make a wrapper around the class. once u have done that create an object of the class and call the openurl method passing the webpage's address the return type of that method is a string containing the webpage's contents. you can find vb samples in msdn too. just convert it to corresponding vc.
0
 

Author Comment

by:-Mihai-
ID: 9813039
well. i need it in vc and i never worked with vb. can you do a simple example please ?
0
 
LVL 9

Expert Comment

by:bhagyesht
ID: 9815560
the procedure i wrote is of VC and the example mentioned is in vb.
0
 

Author Comment

by:-Mihai-
ID: 9827255
well, can you give me a simple example.
0
 
LVL 9

Expert Comment

by:bhagyesht
ID: 9829457
-Mihai- : I guess I have provided enough links and said that the example is in VB Its fairly simple to understand and besides I wrote down what you need to do in case of VC. Please try if you are stuck post the code I shall assist you.
0
 

Author Comment

by:-Mihai-
ID: 9973987
All you gaved me was in VB . I never worked in that stupid language so it's preaty hard for me to modify it for VC. I just need a simple example that open a page and retrive something from it.
0
 
LVL 9

Accepted Solution

by:
bhagyesht earned 500 total points
ID: 9983696
post your email id i shall send across a sample application
0
 

Author Comment

by:-Mihai-
ID: 10008255
raven@pixelrage.ro

Thanks !
0
 

Author Comment

by:-Mihai-
ID: 10676940
bhagyesht can you send me that aplication again ? I haven't received it yet, don't know why :(
0
 
LVL 9

Expert Comment

by:bhagyesht
ID: 10684237
not recieved? I had send in in dec end from my previous co. I will write it again and send it.
Bhagyesh Trivedi
0
 
LVL 9

Expert Comment

by:bhagyesht
ID: 10685702
I have uploaded the code at
http://www34.brinkster.com/bhagyesht/
Bhagyesh Trivedi
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
topping1 challenge 7 90
Arduino EDI - Programming language 3 90
Please help| Getting the syntax error in below query. 2 56
Regular Expression Calculator Tester 2 71
This is an explanation of a simple data model to help parse a JSON feed
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now