473,699 Members | 2,321 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem connecting to remote MySQL DB from VB6

Hello all

The following code allows me to connect to a local MySQL database on my pc
from a VB6 project.

*************** *************** *************** *************** *************** *
**
Dim conn As ADODB.Connectio n
Dim cs As String
Dim MyServer As String
Dim MyDb As String
Dim MyUserID As String
Dim MyPass As String

MyServer = "servername "
MyDb = "database"
MyUserID = "MrUser"
MyPass = "password"

Set conn = New ADODB.Connectio n

cs = "DRIVER={My SQL ODBC 3.51 Driver};"
cs = cs & "server=" & MyServer & ";"
cs = cs & "database=" & MyDb & ";"
cs = cs & "uid=" & MyUserID & ";"
cs = cs & "password=" & MyPass & ";"

conn.Connection String = cs
conn.CursorLoca tion = adUseClient
conn.Open cs

*************** *************** *************** *************** ***************

However when I try to use it to connect to a remote database residing on my
hosting companies server. I get the following message

Runtime error '-2147467259(8000 4005)':
[MySQL][ODBC 3.51 Driver]Access denied for user:
'm************* @client-80-13-38-51.brhm.adsl.vi rgin.net' (Using
password:YES)

The connection info re user, password, database, host etc are all correct.
And the database can be connected to from my site using SQL in PHP script. I
have the latest MyODBC installed correctly. Has anyone experienced this and
if so how can it be resolved. In the error message it seems to think Im
using a password 'YES' however I have no such password and am not using it
in my code anywhere.

Ian
Oct 11 '05 #1
4 8415
Are you sure that the host exposes the MySQL database out? Some host will
only allow access to MySQL DB's through (local) and not through an IP
address - I have had this issue with a host before...

How do you connect to the DB through PHP? Is the server listed as (local).

--
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
Veign's Blog
http://www.veign.com/blog
--
"Ian Davies" <ia********@vir gin.net> wrote in message
news:Tb******** *******@newsfe1-gui.ntli.net...
Hello all

The following code allows me to connect to a local MySQL database on my pc
from a VB6 project.

*************** *************** *************** *************** *************** *
**
Dim conn As ADODB.Connectio n
Dim cs As String
Dim MyServer As String
Dim MyDb As String
Dim MyUserID As String
Dim MyPass As String

MyServer = "servername "
MyDb = "database"
MyUserID = "MrUser"
MyPass = "password"

Set conn = New ADODB.Connectio n

cs = "DRIVER={My SQL ODBC 3.51 Driver};"
cs = cs & "server=" & MyServer & ";"
cs = cs & "database=" & MyDb & ";"
cs = cs & "uid=" & MyUserID & ";"
cs = cs & "password=" & MyPass & ";"

conn.Connection String = cs
conn.CursorLoca tion = adUseClient
conn.Open cs

*************** *************** *************** *************** ***************

However when I try to use it to connect to a remote database residing on
my
hosting companies server. I get the following message

Runtime error '-2147467259(8000 4005)':
[MySQL][ODBC 3.51 Driver]Access denied for user:
'm************* @client-80-13-38-51.brhm.adsl.vi rgin.net' (Using
password:YES)

The connection info re user, password, database, host etc are all correct.
And the database can be connected to from my site using SQL in PHP script.
I
have the latest MyODBC installed correctly. Has anyone experienced this
and
if so how can it be resolved. In the error message it seems to think Im
using a password 'YES' however I have no such password and am not using it
in my code anywhere.

Ian

Oct 12 '05 #2
Thanks for the reply

I create the PHP files on my pc and upload them to the hosts server. I
connect with php using the following in my script.
mysql_pconnect( $hostname, $username, $password)

presumably this is local as the PHP files are on the hosts server?
How do you connect to the DB through PHP? Is the server listed as (local).
How can I confirm if the server listed as (local)?
How did you overcome the problem when you encountered it with your host? I
hope your not going to say I changed host :). Ive just paid for two years
hosting (I hope they offer refund)

Ian
"Veign" <NO***********@ veign.com> wrote in message
news:uo******** ******@TK2MSFTN GP14.phx.gbl... Are you sure that the host exposes the MySQL database out? Some host will
only allow access to MySQL DB's through (local) and not through an IP
address - I have had this issue with a host before...

--
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
Veign's Blog
http://www.veign.com/blog
--
"Ian Davies" <ia********@vir gin.net> wrote in message
news:Tb******** *******@newsfe1-gui.ntli.net...
Hello all

The following code allows me to connect to a local MySQL database on my pc from a VB6 project.

*************** *************** *************** *************** *************** * **
Dim conn As ADODB.Connectio n
Dim cs As String
Dim MyServer As String
Dim MyDb As String
Dim MyUserID As String
Dim MyPass As String

MyServer = "servername "
MyDb = "database"
MyUserID = "MrUser"
MyPass = "password"

Set conn = New ADODB.Connectio n

cs = "DRIVER={My SQL ODBC 3.51 Driver};"
cs = cs & "server=" & MyServer & ";"
cs = cs & "database=" & MyDb & ";"
cs = cs & "uid=" & MyUserID & ";"
cs = cs & "password=" & MyPass & ";"

conn.Connection String = cs
conn.CursorLoca tion = adUseClient
conn.Open cs

*************** *************** *************** *************** ***************
However when I try to use it to connect to a remote database residing on
my
hosting companies server. I get the following message

Runtime error '-2147467259(8000 4005)':
[MySQL][ODBC 3.51 Driver]Access denied for user:
'm************* @client-80-13-38-51.brhm.adsl.vi rgin.net' (Using
password:YES)

The connection info re user, password, database, host etc are all correct. And the database can be connected to from my site using SQL in PHP script. I
have the latest MyODBC installed correctly. Has anyone experienced this
and
if so how can it be resolved. In the error message it seems to think Im
using a password 'YES' however I have no such password and am not using it in my code anywhere.

Ian


Oct 12 '05 #3
Try uploading something like PhpMyAdmin and play around with the server
setting. Set it to (local) and verify it works, now try the IP address or
domain to the DB Server and see if that works.

How I overcame it was switch hosts. They would not expose the MySQL server
out and only supported access through Local from a website on the server.

--
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
Veign's Blog
http://www.veign.com/blog
--
"Ian Davies" <ia********@vir gin.net> wrote in message
news:sa******** ***@newsfe7-gui.ntli.net...
Thanks for the reply

I create the PHP files on my pc and upload them to the hosts server. I
connect with php using the following in my script.
mysql_pconnect( $hostname, $username, $password)

presumably this is local as the PHP files are on the hosts server?
How do you connect to the DB through PHP? Is the server listed as
(local).


How can I confirm if the server listed as (local)?
How did you overcome the problem when you encountered it with your host? I
hope your not going to say I changed host :). Ive just paid for two years
hosting (I hope they offer refund)

Ian
"Veign" <NO***********@ veign.com> wrote in message
news:uo******** ******@TK2MSFTN GP14.phx.gbl...
Are you sure that the host exposes the MySQL database out? Some host
will
only allow access to MySQL DB's through (local) and not through an IP
address - I have had this issue with a host before...


--
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
Veign's Blog
http://www.veign.com/blog
--
"Ian Davies" <ia********@vir gin.net> wrote in message
news:Tb******** *******@newsfe1-gui.ntli.net...
> Hello all
>
> The following code allows me to connect to a local MySQL database on my pc > from a VB6 project.
>
> *************** *************** *************** *************** *************** * > **
> Dim conn As ADODB.Connectio n
> Dim cs As String
> Dim MyServer As String
> Dim MyDb As String
> Dim MyUserID As String
> Dim MyPass As String
>
> MyServer = "servername "
> MyDb = "database"
> MyUserID = "MrUser"
> MyPass = "password"
>
> Set conn = New ADODB.Connectio n
>
> cs = "DRIVER={My SQL ODBC 3.51 Driver};"
> cs = cs & "server=" & MyServer & ";"
> cs = cs & "database=" & MyDb & ";"
> cs = cs & "uid=" & MyUserID & ";"
> cs = cs & "password=" & MyPass & ";"
>
> conn.Connection String = cs
> conn.CursorLoca tion = adUseClient
> conn.Open cs
>
> *************** *************** *************** *************** *************** >
> However when I try to use it to connect to a remote database residing
> on
> my
> hosting companies server. I get the following message
>
> Runtime error '-2147467259(8000 4005)':
> [MySQL][ODBC 3.51 Driver]Access denied for user:
> 'm************* @client-80-13-38-51.brhm.adsl.vi rgin.net' (Using
> password:YES)
>
> The connection info re user, password, database, host etc are all correct. > And the database can be connected to from my site using SQL in PHP script. > I
> have the latest MyODBC installed correctly. Has anyone experienced this
> and
> if so how can it be resolved. In the error message it seems to think Im
> using a password 'YES' however I have no such password and am not using it > in my code anywhere.
>
> Ian
>
>



Oct 12 '05 #4
I will look into your suggestions
The idea was to be able to collect records from the remote database to the
client DB using VB. I am wondering if it is a restriction put in place by my
host would it be possible to do the transfer of records from the server side
using the website and PHP scripts to the users databases. If so what
technologies would be needed to do this?
Ian

"Veign" <NO***********@ veign.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Try uploading something like PhpMyAdmin and play around with the server
setting. Set it to (local) and verify it works, now try the IP address or
domain to the DB Server and see if that works.

How I overcame it was switch hosts. They would not expose the MySQL server out and only supported access through Local from a website on the server.

--
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
Veign's Blog
http://www.veign.com/blog
--
"Ian Davies" <ia********@vir gin.net> wrote in message
news:sa******** ***@newsfe7-gui.ntli.net...
Thanks for the reply

I create the PHP files on my pc and upload them to the hosts server. I
connect with php using the following in my script.
mysql_pconnect( $hostname, $username, $password)

presumably this is local as the PHP files are on the hosts server?
How do you connect to the DB through PHP? Is the server listed as
(local).


How can I confirm if the server listed as (local)?
How did you overcome the problem when you encountered it with your host? I
hope your not going to say I changed host :). Ive just paid for two years hosting (I hope they offer refund)

Ian
"Veign" <NO***********@ veign.com> wrote in message
news:uo******** ******@TK2MSFTN GP14.phx.gbl...
Are you sure that the host exposes the MySQL database out? Some host
will
only allow access to MySQL DB's through (local) and not through an IP
address - I have had this issue with a host before...


--
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
Veign's Blog
http://www.veign.com/blog
--
"Ian Davies" <ia********@vir gin.net> wrote in message
news:Tb******** *******@newsfe1-gui.ntli.net...
> Hello all
>
> The following code allows me to connect to a local MySQL database on my
pc
> from a VB6 project.
>
>

*************** *************** *************** *************** *************** * > **
> Dim conn As ADODB.Connectio n
> Dim cs As String
> Dim MyServer As String
> Dim MyDb As String
> Dim MyUserID As String
> Dim MyPass As String
>
> MyServer = "servername "
> MyDb = "database"
> MyUserID = "MrUser"
> MyPass = "password"
>
> Set conn = New ADODB.Connectio n
>
> cs = "DRIVER={My SQL ODBC 3.51 Driver};"
> cs = cs & "server=" & MyServer & ";"
> cs = cs & "database=" & MyDb & ";"
> cs = cs & "uid=" & MyUserID & ";"
> cs = cs & "password=" & MyPass & ";"
>
> conn.Connection String = cs
> conn.CursorLoca tion = adUseClient
> conn.Open cs
>
>

*************** *************** *************** *************** ***************
>
> However when I try to use it to connect to a remote database residing
> on
> my
> hosting companies server. I get the following message
>
> Runtime error '-2147467259(8000 4005)':
> [MySQL][ODBC 3.51 Driver]Access denied for user:
> 'm************* @client-80-13-38-51.brhm.adsl.vi rgin.net' (Using
> password:YES)
>
> The connection info re user, password, database, host etc are all

correct.
> And the database can be connected to from my site using SQL in PHP

script.
> I
> have the latest MyODBC installed correctly. Has anyone experienced this > and
> if so how can it be resolved. In the error message it seems to think Im > using a password 'YES' however I have no such password and am not

using it
> in my code anywhere.
>
> Ian
>
>



Oct 12 '05 #5

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

Similar topics

0
2057
by: maddunr | last post by:
Hi, I just installed PHP 4.3.9, MySQL 4.0.2 and PHPMyAdmin 2.6.0-pl3 on our intranet server (Win2k3 running IIS). I also have a similar setup on my local machine (http://localhost/phpmyadmin). Everything seems normal when I work on the server machine (also known as web-nt with IP xxx.xxx.xx.xx), but when I try connecting to the MySQL database on the server from my local machine (http://web-nt/phpmyadmin), two things happen:
3
6168
by: kamilla | last post by:
I have a mysql 3.5 server installed on a suse linux 8.1, with address 10.0.0.100. Now I want to access that db from a W2K pc, address 10.0.0.200. I am able to ping 10.0.0.100, but I cannot connect to the db, and get error 2013. I have tried with MySQL Administrator 1.0 and also with ODBC. The db on linux has grant all on *.* to ''@'10.0.0.%' and also tried .... to root@10.0.0.200 and others seen on posted messages. I can access that db...
3
5129
by: David | last post by:
Hi, Ive been trying to work this out for the past 2 days now and im not getting anywhere fast. The problem i have is that i am using Asynchronous sockets to create a Socket Client library. When i try to connect to a server that doesnt exist it raises a "Connection forcibly rejected by the resmote host" SocketException.
2
3554
by: John | last post by:
Hi I was working fine with create user wizard and the default membership provider. I have now customised the membership provider as per attached web.config. The create user wizard picks up the custom membership provider fine and removes the security question/answer fields as designated in the custom provider. The problem is that when I try to create a new user in the create user wizard by entering the info and pressing the 'create...
8
55676
by: Kevin D. | last post by:
Please note, I already posted this on the MySQL official forum, but received no response. I thought I'd try again in another location. My apologies to anyone reading this twice... Despite everything I've tried, I cannot get MySQL to start as a Windows service. However, I AM able to get it started via the mysqld-nt --console command. Here is my (funky) setup:
0
3919
by: Suresh | last post by:
Hi Guys I have Db2 server installed on remote server. i am connecting to that remote server by using VPN. I want to connect that remote DB2 server instance using my local machine DB2 development client. Bur Its gives me following error message. I searched lots of things on net and tried on remote server but i didnt got suceess. Can any one tell me how to set TCP\IP connection protocol on server for particular instance. Becuase I think
1
2382
by: ynyus75 | last post by:
Hey! I am unable to connect some of the services that I host from my laptop at home, such as SMTP and MySQL on port numbers 25 and 3306 respectively. But I am able to some services such as Telnet, Remote Desk Connection, SSH. Here are my details ISP: Time Warner Connection Type: Cable Router: Lynksys Port Farwarding: enabled port farwarding to HTTP, Telnet, HTTPS, Remote Desktop Connection, SSH, MySQL etc to my laptop. Connection...
1
4343
by: spatro | last post by:
Hi, I am trying to install DBD::mysql using the CPAN and I am facing the following error: cpan> install DBD::mysql CPAN: Storable loaded ok Going to read /root/.cpan/Metadata Warning: Found only 0 objects in /root/.cpan/Metadata CPAN: LWP::UserAgent loaded ok
4
1856
by: Cyprus106 | last post by:
I realize how I'm going about this is somewhat odd. I have to construct a program for windows mobile that only sends a couple queries to a remote MySQL server and hopefully gets some success/fail returns. (I've got VS2008 pro and the winmobile SDKs) The 2 problems I have: 1) I'm very well versed in C++, and I know a little C#. I managed to compile some simple winmobile programs, but I'd be more comfortable grabbing a couple of walkthroughs...
0
8623
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9185
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8935
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8893
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7773
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6540
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5879
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3069
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2359
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.