mysql数据复制到access数据库
发布时间:2006-10-14 2:43:46   收集提供:gaoqian
mysql数据库表sqltable
字段id,name,sex,email

access数据库表accesstable
id,name,sex,email

<?  
    $connect = mysql_connect("localhost","","");  
    mysql_select_db("mydatabase");  
    $sql = "select * from sqltable;
    $result = mysql_query($sql};  
    $connectodbc=odbc_connect("DSN","USERNAME","PASSWORD");  
        while($row = mysql_fetch_row($result))
    {
        $sql="insert into accesstable  

values($row["id",$row["name",$row["sex"],$row["email"])";  
        odbc_do($connectodbc,$sql);  
        }
        odbc_close($connectodbc);
        mysql_close($conect);
?>  

【本文版权归作者与奥索网共同拥有,如需转载,请注明作者及出处】    


 
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50