473,408 Members | 2,813 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,408 software developers and data experts.

Connecting to MySQL at Startup

Hello,

I've installed the ODBC connector for MySQL and can go into Access and
manually link to the MySQL tables. Everything works fine this way.

But rather than go into the Windows Data Source Adminstrator on each
user's computer, how would you code an MS Access front end to connect
to MySQL tables at startup? Where would you put the code and how
would you call it when the Access database is opened?

Thanks for your help!
Mar 15 '08 #1
5 3396
On Sat, 15 Mar 2008 12:10:47 -0700 (PDT), WPW07 <ww********@gmail.com>
wrote:

An ODBC datasource (DSN) can be created by adding the right entries to
the registry. Just run regedit.exe and search for one by name. You can
export the key, and then import it using a command line: regedit.exe
your.reg

Reattach code is a FAQ. You should have no problem finding
suggestions. Keyword: RefreshLink

-Tom.

>Hello,

I've installed the ODBC connector for MySQL and can go into Access and
manually link to the MySQL tables. Everything works fine this way.

But rather than go into the Windows Data Source Adminstrator on each
user's computer, how would you code an MS Access front end to connect
to MySQL tables at startup? Where would you put the code and how
would you call it when the Access database is opened?

Thanks for your help!
Mar 15 '08 #2
DFS
WPW07 wrote:
Hello,

I've installed the ODBC connector for MySQL and can go into Access and
manually link to the MySQL tables. Everything works fine this way.

But rather than go into the Windows Data Source Adminstrator on each
user's computer, how would you code an MS Access front end to connect
to MySQL tables at startup? Where would you put the code and how
would you call it when the Access database is opened?

Thanks for your help!
What I do is on my development system I create the ODBC datasource and all
table links.

Then in the code that executes at startup I re/create the ODBC datasource

dim cTxt As String
cTxt = "Description=building photos"
cTxt = cTxt & Chr(13) & "Database=PHOTOS"
cTxt = cTxt & Chr(13) & "Server=192.111.111.11"
DBEngine.RegisterDatabase "BldgPhotos", "SQL Server", True, cTxt


Mar 16 '08 #3
On Mar 15, 8:58 pm, "DFS" <nospam@dfs_.comwrote:
WPW07 wrote:
Hello,
I've installed the ODBC connector for MySQL and can go into Access and
manually link to the MySQL tables. Everything works fine this way.
But rather than go into the Windows Data Source Adminstrator on each
user's computer, how would you code an MS Access front end to connect
to MySQL tables at startup? Where would you put the code and how
would you call it when the Access database is opened?
Thanks for your help!

What I do is on my development system I create the ODBC datasource and all
table links.

Then in the code that executes at startup I re/create the ODBC datasource

dim cTxt As String
cTxt = "Description=building photos"
cTxt = cTxt & Chr(13) & "Database=PHOTOS"
cTxt = cTxt & Chr(13) & "Server=192.111.111.11"
DBEngine.RegisterDatabase "BldgPhotos", "SQL Server", True, cTxt
Thanks DFS. That's exactly what I'm looking to do. Just one
question. Where do I find the "code that executes at startup" so that
I add the ODBC datasource code?
Mar 16 '08 #4
DFS
WPW07 wrote:
On Mar 15, 8:58 pm, "DFS" <nospam@dfs_.comwrote:
>WPW07 wrote:
>>Hello,
>>I've installed the ODBC connector for MySQL and can go into Access
and manually link to the MySQL tables. Everything works fine this
way.
>>But rather than go into the Windows Data Source Adminstrator on each
user's computer, how would you code an MS Access front end to
connect to MySQL tables at startup? Where would you put the code
and how would you call it when the Access database is opened?
>>Thanks for your help!

What I do is on my development system I create the ODBC datasource
and all table links.

Then in the code that executes at startup I re/create the ODBC
datasource

dim cTxt As String
cTxt = "Description=building photos"
cTxt = cTxt & Chr(13) & "Database=PHOTOS"
cTxt = cTxt & Chr(13) & "Server=192.111.111.11"
DBEngine.RegisterDatabase "BldgPhotos", "SQL Server", True, cTxt

Thanks DFS. That's exactly what I'm looking to do. Just one
question. Where do I find the "code that executes at startup" so that
I add the ODBC datasource code?
Create a Public Function (in a module) that gets called from a macro named
'autoexec'.

Mar 16 '08 #5
On Mar 15, 9:22 pm, "DFS" <nospam@dfs_.comwrote:
WPW07 wrote:
On Mar 15, 8:58 pm, "DFS" <nospam@dfs_.comwrote:
WPW07 wrote:
Hello,
>I've installed the ODBC connector for MySQL and can go into Access
and manually link to the MySQL tables. Everything works fine this
way.
>But rather than go into the Windows Data Source Adminstrator on each
user's computer, how would you code an MS Access front end to
connect to MySQL tables at startup? Where would you put the code
and how would you call it when the Access database is opened?
>Thanks for your help!
What I do is on my development system I create the ODBC datasource
and all table links.
Then in the code that executes at startup I re/create the ODBC
datasource
dim cTxt As String
cTxt = "Description=building photos"
cTxt = cTxt & Chr(13) & "Database=PHOTOS"
cTxt = cTxt & Chr(13) & "Server=192.111.111.11"
DBEngine.RegisterDatabase "BldgPhotos", "SQL Server", True, cTxt
Thanks DFS. That's exactly what I'm looking to do. Just one
question. Where do I find the "code that executes at startup" so that
I add the ODBC datasource code?

Create a Public Function (in a module) that gets called from a macro named
'autoexec'.

Great...thanks again!

Mar 16 '08 #6

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

Similar topics

0
by: Duane Winner | last post by:
Hello all - I'm having a small problem with the mysql startup script that ships with MySQL-3.23.56-1. I'm running on RedHat Linux. It works fine, but I have a backup server that runs a script...
0
by: Stefan Hinz | last post by:
Degan, jumping in to try and solve some problems that look pretty obvious to me ... > #options for default service (mysqld2) > (mysqld2) It should be , not (mysqld2).
16
by: MLH | last post by:
Using MS Access, I have attached to MySQL servers in other states and other countries on the other side of my router. But when I use the MySQL ODBC driver 3.51 to connect to a MySQL server on my...
3
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...
4
by: steve | last post by:
I like to create some temprary tables (in-memory tables) when mysql starts up. How do I do that. Thanks. -- Posted using the http://www.dbforumz.com interface, at author's request Articles...
4
by: Manzoorul Hassan | last post by:
I am not able to connect to the mysql DB if I am not the root user. I have already found identified an issue: * mysql.sock is NOT located in /tmp So, to get around it I created a sym link to...
3
by: Jeremy Dillinger | last post by:
I am trying to design a program that will use data from a MySQL database. Currently all the data is being used with PHP scripts from a website. I am also trying to build a software solution that...
1
by: ironcito | last post by:
Hello, I installed Apache 2.0.55, PHP 5.1.1, and MySQL 5.0.17 (in that order, on Windows XP). I have managed to get Apache and PHP working right, and MySQL by itself seems ok too. However, when...
8
by: Ananthu | last post by:
Hi I have done all the codings part for connecting mysql with java in eclipse environment. Coding Part: import java.sql.Connection; import java.sql.DriverManager; public class...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
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
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...
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,...
0
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...

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.