473,396 Members | 2,059 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

MySQL and Winsock

Hi ,

I'm trying to make an app in vc++ that access my MySQL db and then
email me some data. I'm mailing with winsock. Whenever i email with
winsock then i can't connect with MySQL db(anymore). Here is my
listing:

Smtp smtp("www.mydomain.nl","info","test","in**@mydomai n.nl");
smtp.sendMail("test3","us**@domain.nl","test3");
smtp.closeConnection();

db_MySQL db ("www.mydomain.nl","root","test","algemeen");
Rs_MySQL rs1 (db);
Rs_MySQL rs2 (db);

string sql = "SELECT * FROM `quote properties`";

rs1.get_result(sql);
int amountquoteusers = rs1.num_rows();

The sendmail is going perfect but when i construct db_MySQL object it
fails in the constructor. In the constructer i call mysql_real_connect
and returns an empty MYSQL object. But if the sendmail code is after
the db code then the db connection is succesfull, like this:

db_MySQL db ("www.mydomain.nl","root","test","algemeen");
Rs_MySQL rs1 (db);
Rs_MySQL rs2 (db);

string sql = "SELECT * FROM `quote properties`";

rs1.get_result(sql);
int amountquoteusers = rs1.num_rows();

Smtp smtp("www.mydomain.nl","info","test","in**@mydomai n.nl");
smtp.sendMail("test3","us**@domain.nl","test3");
smtp.closeConnection();

Anyways i'm getting crazyyyyy!

Thx,

Q.
Jul 20 '05 #1
0 1414

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Niels Borg | last post by:
Hi, I'm writing app where I use WinSock, but I have experienced a problem. WinSock only sends the data after finishing the calling sub/function. Can I force WinSock immediately as I need to send...
4
by: Baui | last post by:
Dear group I am a newbie to C++, so probably this question has a very obvious answer: I try to compile the example from the MySQL docu on http://dev.mysql.com/doc/mysql/en/libmysqld_example.html...
3
by: Bill | last post by:
When vb6 Winsock.RemoteHost is set to "127.0.0.1", c# socket listener cannot hear connect request (my old vb6 winsock listener could hear it...). Why doesn't this work, and is there a work...
1
by: Yu Chai | last post by:
Hi guys, I created a ASP page that 1. users can run when WinSock proxy are using (ie's one is unchecked) 2. users can't run when WinSock proxy are using (ie's one is checked) 3. users can't run...
7
by: Nadav | last post by:
Hi I am writing some kind of a storage system that have to deal with large amounts of data passing over the net, Now, I Wonder... traditional programming would use win32 Winsock DLL as the means...
5
by: kc | last post by:
Hi Just upgrading a app from VB6 to VB.Net. All is going well apart from the Winsock control. The first thing we notice is that there does not appear to be a .Net version (please correct me if...
1
by: Nicolas Ghesquiere | last post by:
Hello I have a problem with my current program. The meaning of the program is to allow users to login to a server to allow them to access the internet. My program communicates with a MS isa...
4
by: imaloner | last post by:
I am posting two threads because I have two different problems, but both have the same background information. Common Background Information: I am trying to rebuild code for a working,...
3
AaronL
by: AaronL | last post by:
Hello, I am currently working on a project that has me in sort of a bind. What I want to do is retrieve web pages from the internet, and strip them down to just text. I'll get using Regular...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.