PHP ²Ù×÷Access (ÕýÈ·)
µÚÒ»ÖÖ·½·¨£º
<?php
class Access{
function getConn(){
$conn = @new COM("ADODB.Connection") or die ("ADOÁ¬½Óʧ°Ü!");
$connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" . realpath(__IMPL__."/db2.mdb");
$conn->Open($connstr);
return $conn;
}
}
?>
²Ù×÷£º
д£º
$sql="insert into stu (name) values ('$name')";
$rs = $conn->Execute($sql);
¶Á£º
$rs=$conn->Execute('select * from stu');
while(!$rs->EOF){
$id=$rs->fields['id']->value;
$name=$rs->fields['name']->value;
$rs->movenext();
}
$rs->close();
$conn->close();
¸Ä£º
$sql="update stu set age='".$age."' where id=".$id;
$rs=$conn->Execute($sql);
$conn->close();
ɾ£º
$sql="delete from stu where id=".$id;
$rs = $conn->Execute($sql);
$conn->close();
·½·¨¶þ£º
<?php
class Access1{
function getConn(){
$connstr="DRIVER=Microsoft Access Driver (*.mdb);DBQ=".realpath(__IMPL__."/db2.mdb");
&nbs
Ïà¹ØÎĵµ£º
1¡¢Ç°ÑÔ
¡¡¡¡·ÖÒ³ÏÔʾÊÇÒ»Öַdz£³£¼ûµÄä¯ÀÀºÍÏÔʾ´óÁ¿Êý¾ÝµÄ·½·¨£¬ÊôÓÚweb±à³ÌÖÐ×î³£´¦ÀíµÄʼþÖ®Ò»¡£¶ÔÓÚweb±à³ÌµÄÀÏÊÖÀ´Ëµ£¬±àдÕâÖÖ´úÂëʵÔÚÊǺͺôÎüÒ»Ñù×ÔÈ»£¬µ«ÊǶÔÓÚ³õѧÕßÀ´Ëµ£¬³£³£¶ÔÕâ¸öÎÊÌâÃþ²»×ÅÍ·Ð÷£¬Òò´ËÌصØ׫д´ËÎĶÔÕâ¸öÎÊÌâ½øÐÐÏêϸµÄ½²½â£¬Á¦ÇóÈÿ´ÍêÕâƪÎÄÕµÄÅóÓÑÔÚ¿´ÍêÒÔºó¶ÔÓÚ·ÖÒ³ÏÔʾµÄÔ ......
±àд¹ØÓÚ PHP µÄϵÁÐÎÄÕÂÈÃÎÒ¸ü¼ÓÉî¿ÌµØÁ˽âÁË PHP ¿ª·¢ÈËÔ±µÄÊÀ½ç¡£ÎÒºÍÐí¶à PHP ³ÌÐòÔ±½»Ì¸¹ý£¬×îÁîÎÒ¾ªÆæµÄÊÇÖ»ÓкÜÉÙµÄÈËʹÓà IDE¡£´ó¶àÊý³ÌÐòԱʹÓÃÎı¾±à¼Æ÷£¬±ÈÈç Microsoft® Windows® ÉϵļÇʱ¾¡¢Emacs »òÕß Vim¡£
ÎÒÌáµ½µÄÕâЩÎı¾±à¼Æ÷£¨ÒÔ¼°ÎÒûÌáµ½£©¶¼ÊǺܲ»´íµÄ —— ÎÒ²»ÏëÌÖÂÛ ......
1.ËùÓеÄÊý¾Ý¶¼Ó¦¸ÃÒþ²ØÔÚËùÔÚµÄÀàµÄÄÚ²¿¡£
2.ÀàµÄʹÓÃÕß±ØÐëÒÀÀµÀàµÄ¹«¹²½Ó¿Ú£¬µ«À಻ÄÜÒÀÀµËûµÄʹÓÃÕß¡£
3.¾¡Á¿¼õÉÙÀàÐÒéÖеÄÏûÏ¢¡£
4.ʵÏÖËùÓÐÀ඼Àí½âµÄ×î»ù±¾µÄ½Ó¿Ú¡££¨¿½±´²Ù×÷£¬°üÀ¨É±´ºÍdz¿½±´£©£¬ÏàµÈÐÔÅжϣ¬ÕýÈ·Êä³öÄÚÈÝ£¬´ÓASC2ÃèÊö½âÎöµÈµÈ¡£
5.²»°ÑʵÏÖϸ½ÚÈç·ÀÖ¹¹«¹²´úÂëµÄ˽Óк¯Êý.·Åµ½ÀàµÄ¹²Óнӿ ......
½ñÌìÔÚ¼ÒÀïÖØа²×°ÁËÒ»ÏÂPHP µ±ÈÃÒ²ÓÐApacheÁË¡£µ«ÊÇÎÒÓöµ½ÁËÒ»¸öÎÊÌ⣬¾ÍÊÇApache·þÎñÎÞ·¨¿ªÆô£¬ºó¹ûÔõÑùÎÒÏëºÜ¶àÈ˶¼ÊÇÖªµÀµÄ£¬µ±Ê±Ò²Ã»ÓжàÏ룬ÒÔΪÊÇ×Ô¼º°²×°µÄʱºò³öÏÖÁËʧÎó¾ÍÖØа²×°Ò»±é£¬¿ÉÊÇ»¹ÊÇÒ»ÑùÎÞ·¨´ò¿ª£¬È»ºóÎÒ¾ÍÔÚÏëÊÇʲôÎÊÌ⣬¶Ë¿ÚºÅ80.ÎҲ鿴ÁËһϣ¬·¢ÏÖûÓдíÎó°¡£¬Ë¼¿¼Á˺ܾ㬶ÔÍøÂçÒÔ¼°·À» ......
//¶ÁÈ¡±ê×¼Áбí
private void setModelList()
{
OleDbConnection Connection = null;
&n ......