473,487 Members | 2,461 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to Connect MYSQL to MS ACCESS in NETWORK?

132 New Member
Hi all!!
I have MYSQL server running in one machine (say PC1 with IP 192.168.0.45) and I want to connect to MS-ACCESS in another machine (say PC2) on the same network.
How can I go about it? Please help!!!!!!!!!!!
Jun 1 '13 #1
4 4667
Oralloy
988 Recognized Expert Contributor
http://connectionstrings.com/Mr Key,

Do you know how to set up an ODBC connection? I assume not.

I'm assuming the client is a windoze machine.

First, open the Control Panel.

If running Windows Xp, 7, or 8, open the "Administrative Tools".

Next, open "Data Sources" or "Data Sources (ODBC)".

Then you have to "Add" a data source. Which type "User DSN", or "System DSN" is up to you (and whether you have administrative control on the system).

It will give you a list of available data source types. Select the one for MySQL. If you do not have one for MySQL, you will have to install the appropriate driver first.

Once you've selected the data source type, a connection dialogue will display - populate it and test your connection.

Once you've got the data source set up, close out the control panel. Remember the name; I will use the string"mySQL-DB" in the example, just to keep consistency. Also, for security reasons, I would suggest that you not store username and password as part of the perminant ODBC connection.

In Access, you create a database connection something like this:
Expand|Select|Wrap|Line Numbers
  1.  
  2. ''--establish the connection string
  3. ''  NOTE:
  4. ''    <username> is your database login username
  5. ''    <password> is your database login password
  6. Dim dbODBC As String
  7. Let dbODBC = "DSN=mySQL-DB;UID=<username>;PWD=<password>;"
  8.  
  9. ''--connection object
  10. Dim dbConn As ADODB.Connection
  11. Set dbConn = New ADODB.Connection
  12.  
  13. ''--attempt connection
  14. dbConn.Open dbODBC
  15. If dbConn.State = adStateOpen Then
  16.   dbConn.Close
  17.   MsgBox "Yay!  Was able to connect!"
  18. Else
  19.   MsgBox "Boo! Hiss!  Failed to connect!" & Chr(10) & Err.Description
  20. End If
  21.  
  22.  

This page on ODBC Administration might be useful to you.

This page has a great deal of information on constructing MySQL ODBC connection strings.

There are lots of code examples about the 'Net.

Kind Regards,
Oralloy
Jun 1 '13 #2
Mr Key
132 New Member
Ok thanks Orollay!!
I know how to connect with ODBC in local machine but my question is on networked computers. Say Computer1 as a server installed with MYSQL and Computer2 as a client machine installed with MS_ACCESS with its applications. I can use MS applications on the same machine with MYSQL using ODBC connection as a link. I can also connect by PHPMYADMIN on network. but I need ODBC in network to simplify applications buildup like forms and several reports.
Please help!!!
Jun 2 '13 #3
Oralloy
988 Recognized Expert Contributor
Mr. Key,

I don't have a MySQL instance to test against, but isn't one of the options in the MySQL ODBC setup the server name or IP address?

Anyway, on Computer2, the client machine, you have to setup the ODBC connection to the MySQL instance on Computer1.

If Computer2 doesn't have it, you will have to install the ODBC driver for MySQL on it. The mySQL site has two pages for connectors/ODBC-drivers:
  1. Latest MySQL Version
  2. Older MySQL Versions

Hope that helps.
Oralloy
Jun 2 '13 #4
Mr Key
132 New Member
Here is the step achieved to accomplish this task.

A:On the MYSQL server machine
1.Add Mysql port 3306 to the exceptions list of windows FIREWALL
2.Give GRANTS to users that supposed to use MYSQL
i. If you are using windows XP, On the command line just go the directory yo have installed MYSQL as follows.
$ C:\Program Files\MySQL\MySQL Server 5.6\bin
then write
$ mysql -u root -p
$ Enter pasword:

mysql> use mysql;
mysql> GRANT ALL ON *.* to databaseuser IDENTIFIED BY 'your-password';
mysql> FLUSH PRIVILEGES;

B: On the Client Machine
1. Install ODBC connector
2. Open Access then go to Externaldata>>ODBC database>>Select datasource then add NEW then select MYSQL ODBC 5.1 DRIVER then OK
3. Write the name of the file you want the data to be stored then click next then finish. The pop_up window will display.
4. On the POP_UP window, TCP/IP server write the IP address of the MYSQL server machine and then fill in the username and password of MYSQL user.
5. Choose appropriate database you want to select from COMBOBOX displayed then click OK>>OK>> then select appropriate tables you want to connect too!! then click finish. You are done
Jun 3 '13 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
4640
by: pratchaya | last post by:
What the best language code to connect MySQL --> C , C++ , php,VB,Delphi ? about ---- Speed ---- Stable ---- Security Can anyone compare C , C++ , php4,php5 ,vb ,delphi to connect to...
2
4906
by: Beda Christoph Hammerschmidt | last post by:
MySQL, Access, ODBC, Replication Hello, i have a central mysql database that is accesed by multiple clients running MS Access with ODBC. This works fine if Access has a permanent connection...
2
1877
by: CM Manager via DotNetMonster.com | last post by:
I am very frustrated due to this exception error I am receiving. I've tried searching numerous user support groups, Microsoft Support Net, Google, etc. and haven't found exactly my situation....
1
3396
by: Sparky | last post by:
Hi I was wondering if someone can please enlighten me as to the best and most approved way to connect and disconnect network drives in vb.net. I have been using Mpr.dll API calls such as...
0
1323
by: Parvez | last post by:
HI How to connect MS ACCESS in Netwaork base VB6.0 Programme from server I AM DEVLOPING A EMPLOYE ATTANEDENS RECORD PROJECT IN THIS I AM USING VB6.0 AND MS ACCESS AND WINDOEW XP IN MY PROJECT...
1
2944
by: shun | last post by:
Hello, I need an sample program to connect mysql server by using odbc. thanks in advance
3
9670
by: Kevin Killion | last post by:
I've recently features to a system by making use of some simple MySQL access routines. It works fine at most test locations, correctkly accessing a MySQL database on an internet server. ...
7
4901
nev
by: nev | last post by:
Can anyone tell me the steps how to do this or direct me to a link? I connect MySQL during runtime. I was wondering if its possible during design time so that I can use the IDE to manage all my MySQL...
5
1788
by: martin99 | last post by:
Hi, I can run a test scrip that connects to the and it CONNECTS successfully whilst running from the my website on the server. $sqlhost = 'localhost'; $sqluser = 'userid'; $sqlpass =...
3
7346
by: likigoldenstar | last post by:
Hi, I have some problem in developing program using PHP. I 'll explain my platforms: I use appserv-win32-2.5.9 as a app server. In the server, mysql client version is 5.0.37 Problems:
0
7108
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
6967
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
7181
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6847
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
4565
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...
0
3071
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1383
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 ...
1
618
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
272
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.