954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Connecting to MS Access with PHP

Hi,

I'm trying to connect to a MS Access database on a server in PHP without having to use ODBC does anyone have any idea or know how. Please help? Thank you.

happyhappy
Newbie Poster
5 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0
 

Using ODBC is by far the easiest way to do this, since you can connect to any database, on any computer on your network. It happens to be really simple to configure in Administrative Tools as well.

Is there any reason why you can't or don't want to use ODBC?

iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
 

Hi,
Thank you for your reply its not that I dont't want o use it, but I'm trying to create an MS Access database and a web page that gets all its information loaded from the MS Access database using PHP code and upload it onto a server. I' ve been able to do from a MySQL database but this other server only has an MS Access. When I research it says to use an ODBC so I'm lost. Do you have any clue on what I should do.

Thank you

happyhappy
Newbie Poster
5 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0
 
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
 

hey yo I am sorry but that is very dumb..Why use PHP + MS Access that is a sucky combination. You see php is much much better with MySql. If you really need to use MS Access then I recomend you start getting into Asp.Net which just happens to be a little better with both MySql and Ms Access it really does not matter..You know what here is the code if you listen to me.

First things first. Make sure you have referenced System.Data and System.Data.OleDb like this

<%@ Page Language="C#/VB" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.OleDb" %>


Then lets say you have a button and a textbox and the button is suppossed to execute a query from an Ms Access database. Lets also say this is the code for the button and textbox within the aspx page.

<asp:TextBox id="TextBox1" runat="server">
<asp:Button id="Button1" runat="server" text="Execute Query" onclick="Do_Query"></asp:Button>


Then you would have to add this between your

hax_hp
Newbie Poster
4 posts since Nov 2007
Reputation Points: 10
Solved Threads: 1
 

hey yo I am sorry but that is very dumb..Why use PHP + MS Access that is a sucky combination. You see php is much much better with MySql. If you really need to use MS Access then I recomend you start getting into Asp.Net which just happens to be a little better with both MySql and Ms Access it really does not matter..You know what here is the code if you listen to me.

First things first. Make sure you have referenced System.Data and System.Data.OleDb like this

<%@ Page Language="C#/VB" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.OleDb" %>

Then lets say you have a button and a textbox and the button is suppossed to execute a query from an Ms Access database. Lets also say this is the code for the button and textbox within the aspx page.

<asp:TextBox id="TextBox1" runat="server">
<asp:Button id="Button1" runat="server" text="Execute Query" onclick="Do_Query"></asp:Button>

Then you would have to add this between your

1. Stop bumping old threads
2. Even if you bump an old thread, answer to the point. The OP asked for connecting to ms-access using "PHP" and not .net.

nav33n
Purple hazed!
Moderator
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
 

Hi, I know the idea is dumb and I think it would be better to do it with asp.net like you said but I am not that familiar with asp.net I have tried a couple of times but can't get it to work with asp.net. It's because I don't know it well enough. If you are willing to help me I am willing to try. I have found a DSN-Less connection code in ASP.Net 2.0 that will display the information from the database, but then I don't know and can't figure out code to display the info the way I want it and the pictures. Thanks for your replies.

hey yo I am sorry but that is very dumb..Why use PHP + MS Access that is a sucky combination. You see php is much much better with MySql. If you really need to use MS Access then I recomend you start getting into Asp.Net which just happens to be a little better with both MySql and Ms Access it really does not matter..You know what here is the code if you listen to me.

First things first. Make sure you have referenced System.Data and System.Data.OleDb like this

<%@ Page Language="C#/VB" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.OleDb" %>

Then lets say you have a button and a textbox and the button is suppossed to execute a query from an Ms Access database. Lets also say this is the code for the button and textbox within the aspx page.

<asp:TextBox id="TextBox1" runat="server">
<asp:Button id="Button1" runat="server" text="Execute Query" onclick="Do_Query"></asp:Button>

Then you would have to add this between your

happyhappy
Newbie Poster
5 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You