Jump to content

Example About Connection To Ms Access


fillbrain

Recommended Posts

Hi all,i am unskilled about php and other language. but i start to learn php and i have a problem with connection and query from ms access database. if anybody have a example about that they can send me files about that. my mail adress is fillbrain@gmail.com Best regards

Link to comment
Share on other sites

To connect to Access from PHP, you need to use ODBC. For an example, see W3Schools' PHP ODBC tutorial page.
thank you for your advice but i read that tutorial but i am not successful. i think i made somethings wrong, it is give to error message. i only want to a simple example files. i hope someone can send to me by mail. my mail address is fillbrain@gmail.com
Link to comment
Share on other sites

i have an persons.mdb database. in that database i made a table and i give to "isciler" name for that table. that table have four header. ID , Adi, Soyadi, Yasand i use below code for to show to my records;<html><body><?php$conn = odbc_connect('persons','','');if (!$conn) {exit("connection Failed: " . $conn);}$sql="SELECT * FROM isciler";$rs=odbc_exec($conn,$sql);if (!$rs) {exit("Error in Sql");}echo "<table><tr>";echo "<th>Adı</th>";echo "<th>Soyadı</th>";echo "<th>Yaşı</th></tr>";while (odbc_fetch_row($rs)) { $adi=odbc_result($rs,"Adi"); $soyadi = odbc_result($rs,"Soyadi"); $yas=odbc_result($rs,"Yas"); echo "<tr><td>$adi</td>"; echo "<td>$soyadi</td>"; echo "<td>$yas</td></tr>"; }odbc_close($conn);echo "</table>";?></body></html>

Link to comment
Share on other sites

Did you followed the instructions on creating an ODBC data source?

Create an ODBC ConnectionWith an ODBC connection, you can connect to any database, on any computer in your network, as long as an ODBC connection is available.Here is how to create an ODBC connection to a MS Access Database: 1.Open the Administrative Tools icon in your Control Panel.2.Double-click on the Data Sources (ODBC) icon inside. 3.Choose the System DSN tab. 4.Click on Add in the System DSN tab. 5.Select the Microsoft Access Driver. Click Finish. 6.In the next screen, click Select to locate the database. 7.Give the database a Data Source Name (DSN). 8.Click OK.Note that this configuration has to be done on the computer where your web site is located. If you are running Internet Information Server (IIS) on your own computer, the instructions above will work, but if your web site is located on a remote server, you have to have physical access to that server, or ask your web host to to set up a DSN for you to use.
Link to comment
Share on other sites

Mr. Robot,i made that settings and it is working by asp .. but i want to learn how can i do it by php. i think i have a problem with my php library but i dont know which file i need i hope in that form they can help to me.. i only want to check my pc have problem or i am wrong with my codesthank you for answers

Link to comment
Share on other sites

For MS Access, that's pretty much the only way.The other way is by using COM, and the MS Access COM API. Doing so is much more hard... so hard in fact, that it's not wort it. Simply forget about Access, and move on to MySQL or another kind of a database.

Link to comment
Share on other sites

PHPMyAdmin is only for MySQL database systems. MS Access has its native interface that is installed as part of the Office suite. However, using the common SQL (structured query language), any supporting database management system can be queried in much the same way. Using an abstraction model such as ODBC, any further differences in the systems are hidden, allowing you to use it with whatever database system you like.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...