X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
   Reply to this topicStart new topic
> Going "dsn-less"    
post Dec 19 2016, 09:54 AM

Posts: 34
Joined: 12-June 15

Recently moved our backend to MySQL. Would like to go DSN-less, simply for the ease of not having to create DSN's on all the target machines.

Did a ton of searching, and found many "pieces", but would like to put it all together. What would be the recommended way to go about connecting an Access front end to a MySQL backend without a DSN?

I'm guessing the best place to do this is the startup form, which is always open. Should I have a local table with a list of tables that we want to connect (it's only 6 or so)? I've found Doug Steele's code to convert linked tables to DSN-less tables, but I'm getting a few errors with that. And I also don't really need to "convert" any tables. Would just like to connect to them on startup.
Go to the top of the page
post Dec 19 2016, 10:43 AM

UA Admin
Posts: 35,902
Joined: 20-June 02
From: Newcastle, WA

Doug's code is intended to work with SQL Server, not MySQL. However, you should be able to adapt it by defining the proper connection string for MySQL.

You didn't mention the specific errors, "...I'm getting a few errors with that." so perhaps you can start by indicating which line(s) raise errors and what those errors are.

And perhaps someone who does use MySQL can offer some tips on valid connection strings for MySQL, or maybe you'll find what you need here.
Go to the top of the page
post Dec 19 2016, 10:55 AM

Posts: 34
Joined: 12-June 15

I'll go through it again. I did modify the connection string for MySQL, and got a 3001 one error I believe. However, I did get it working "I think".

I changed the code a bit from this page. Added the code to the startup form, and all seems to be working as intended. Although I wonder if I'm missing anything.

I guess the next steps are more of a "best practices" type thing. Right now the connection string (server, user, password, etc.) is in the code itself. I saw another use who put those entries in a 1-row table, and call the values from there. Is that done just so you don't have to edit code to change values? Just user preference?

I also saw another post about entering the tables you want to link in a local table on the front end. What's the benefit of that, or that "coder's preference" again?
Go to the top of the page

Custom Search

RSSSearch   Top   Lo-Fi    23rd October 2019 - 09:16 PM