Question:
Converting Access website to MySQL?
Jeffiner2001
2006-04-20 06:48:22 UTC
Our current website accesses a Microsoft Access database. We've been having server issues with WinSave and so I want to switch to a Linux base, which means I have to convert to mySQL format. What will that mean for my website? Will I have to convert all my ASPs into something else? I am totally lost here so any help is appreciated.
Four answers:
2006-04-20 07:47:24 UTC
You're wise to be thinking about converting your database; ASP 3.0 is a legacy product and won't be supported by Microsoft in the near future.



If you really want to convert everything to *nix, I agree that you should consider PHP. The nice thing about PHP is you can use ASP-style tags (<% %>) to denote your script. However, PHP is a C-type language, so you may find the transition from VBScript to PHP daunting at first.



You also have the option of going to ASP.NET and using SQL Server instead of MySQL.



I would argue that unless you have a lot of experience with object-oriented programming, you'd probably find it less intimidating to go to PHP, since the methodologies used by scripting languages, such as ASP 3.0 / PHP, and object-oriented programming, such as ASP.NET, are so different.



With that said, it's my opinion that ASP.NET is a vastly superior product than PHP and is worth learning, but that won't solve your immediate problem.



If your problem is your DB is just too unreliable, you can cheat this issue by just migrating your DB to MySQL, leaving your Web host where it is now, and just changing your connection strings and queries for your MySQL database:



First, to get your Access database into MySQL, you'll want a conversion program. There are lots of them out there; I've used this free script with success:



http://www.cynergi.net/exportsql/exportsql2.txt



You will, of course, need to change your connection strings and whatnot to reflect the new data source.



You don't need to host your site and your MySQL server in the same place; you can always get MySQL from a different machine, or even Web host.



Check to see if your Web host offers MySQL service. If not, you can buy it on the super-cheap (for less than $10 per month) from another provider.



That provider just needs to provide you with MySQL service that uses a unique database server name -- such as mysql.yourdomain.com.



Then, when you are setting up your connection, you just call that host as the source. Here's a sample connection string using the MyODBC provider:



objConn.Open("DRIVER={MySQL ODBC 3.51 Driver}; SERVER=mysql.yourdomain.com; PORT=3306; DATABASE=myDatabase; USER=myUsername; PASSWORD=myPassword; OPTION=3;")



You'll also find there are subtle differences in the SQL that Access and MySQL use. For example, this works in Access SQL:



SELECT * FROM mytable WHERE customer_name = 'Jones" AND order_date = #5/20/2006#



In MySQL, you denote dates the same way you do strings:



SELECT * FROM mytable WHERE customer_name = 'Jones" AND order_date = '5/20/2006'



In fact, it's best in MySQL to not use literal dates at all, but rather to use the *nix timestamp. But that's getting a bit ahead of ourselves.



Assuming you need to move the entire Web site, a good stopgap measure, until you can get everything recoded, is to use Sun Java System Active Server Pages. It allows you to run ASP pages on non-Microsoft servers, including Red Hat Linux.



There are many Web hosts out there that support Sun Java System Active Server Pages; just Google that, or SunOne (its former name) or ChiliSoft ASP (its original name).
abigcubsfan
2006-04-20 06:53:37 UTC
You should consider using the LAMP platform if you are going to switch to mySQL. LAMP meaning (linux-apache-mysql-php). PHP is somewhat similiar to ASP in terms of templated languages that run dynamic web sites that run over a database. The msplatform is ASP with a MS Database (access? or ms-sql). Apache is the web server that is open source and of course we all know what LINUX is. ;-) You should look at other web hosting providers that offer linux support and run thru the platform. Now as far as converting you database, if you have a view in the access database and if you understand the database model you should be able to easily convert from one database to another. Export to a flat file format for each table, understand what the specific keys in each table and you should be good. Hope this helps?
Erax
2006-04-20 06:55:04 UTC
ASP runs on MS IIS only and hence wont run on LINUX coz apache cannot inteprate ASP.If you plan to use linux and apache then you can convert your pages to php or ruby.

For MS ACCESS migration there are some database converters to convert MS-ACCESS to MYSQL
sinkablehail1978
2006-04-20 06:54:25 UTC
unless you have the .net framework installed on the box yes you would need to rewite your Active Server Pages. moving data from access to mySql should not be hard. my suggestion would be to maybe get a copy of Microsoft SQL server and move your data from the access DB to SQL Server. You can just write a DTS package to move all your data over.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...