FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

HOW TO CONNECT MY SITE TO AN ACCESS DATA BASE??

 


drtooty
WHAT IS THE BEST WAY TO CONNECT MY SITE TO AN ACCESS DATA BASE????


NB: AM WEB SITE BEGINNER
a_dubDesign
php all the way. Its really simple language, and since its free everybody has it. php.net is a huge list of all the different functions reltaed to database info, just go there and do a search.
ml
This is an example of how you can pull data from a Microsoft Access database through ADO.

Code:
<?
$conn = new COM("ADODB.Connection") or die("Cannot start ADO");

// Microsoft Access connection string.
$conn->Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=C:\\inetpub\\wwwroot\\php\\mydb.mdb");

// SQL statement to build recordset.
$rs = $conn->Execute("SELECT myfield FROM mytable");
echo "<p>Below is a list of values in the MYDB.MDB database, MYABLE table, MYFIELD field.</p>";

// Display all the values in the records set
while (!$rs->EOF) {
    $fv = $rs->Fields("myfield");
    echo "Value: ".$fv->value."<br>\n";
    $rs->MoveNext();
}
$rs->Close();
?>
dkill001
what luck...I just did this today, quite simple actually - here is a tutorial http://www.phpbuilder.com/columns/siddarth20000228.php3...it uses ODBC to connect....you can connect via a DSNless connection also(ie via ADODB like mentioned above)...I am not sure of the advantages/disadv b/w the diff connection methods
Reply to topic    Frihost Forum Index -> Webmaster and Internet -> Design Tips

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.