PS: This can be extrapolate, such as new cloud or NB and other ASP article system can be converted to dedecms or other PHP cms
Copy the Code code as follows:
Read MDB database routines
Set_time_limit (0);
$conn = new COM ("ADODB. Connection ");
$connstr = "Driver={microsoft Access DRIVER (*.mdb)}; Dbq= ". Realpath ("E:\web2\qq.mdb");
$conn->open ($CONNSTR);
$rs = new COM ("ADODB. RecordSet ");
$rs->open ("select * from Pe_article where articleid>0 OrDER by ArticleID ASC", $conn, 1, 1);
$conn 2 = mysql_connect ("localhost", "root", "");
mysql_select_db ("Dede", $conn 2);
mysql_query ("SET NAMES GBK", $conn 2);
$i = 0;
while (! $rs->eof) {
$id = $rs->fields (' ArticleID ')->value;
$title = Addslashes ($rs->fields (' title ')->value);
$classid = $rs->fields (' ClassID ')->value;
$keywordstr = $rs->fields (' Keyword ')->value;
$keywordstr = Str_replace ("|", "", $keywordstr);
$keyword = Trim ($KEYWORDSTR);
$datestr = $rs->fields (' updatetime ')->value;
$datearr = Explode ("-", $datestr);
$yy = $datearr [0];
$MM = $datearr [1];
$DD = rand (1,28);
$time =mktime (0,0,0, $mm, $DD, $yy);
$content =addslashes ($rs->fields (' content ')->value);
$content = Str_replace (' [installdir_channeldir]{$UploadDir} ', '/uploadfiles ', $content);
$uploadfile = $rs->fields (' uploadfiles ')->value;
$sql 0 = "Select ID from dede_archives where id= ' $id '";
$rs 0 = mysql_query ($sql 0, $conn 2);
$row = Mysql_fetch_array ($rs 0);
if (Intval ($row [' ID ']) ==0) {
$sql 1 = "INSERT into dede_archives (id,typeid,channel,title,sortrank,pubdate,senddate,adminid,keywords) VALUES (' $id ' , ' $classid ', 1, ' $title ', ' $time ', ' $time ', ' $time ', 1, ' $keyword ');
$rs 1 = mysql_query ($sql 1, $conn 2);
if (! $rs 1) {
echo $sql 1;
echo "
";
Echo Mysql_error ();
echo "
";
Exit
}
$id 2 = mysql_insert_id ();
if ($id 2>0) {
$sql 2 = "INSERT into dede_addonarticle (aid, typeid, body) VALUES (' $id ', ' $classid ', ' $content ');";
$rs 2 = mysql_query ($sql 2, $conn 2);
if (! $rs 2) {
echo $sql 2;
echo "
";
Echo Mysql_error ();
echo "
";
Exit
}
}
}
$rs->movenext ();
$i + +;
if ($i%50==0) sleep (5);
}
echo "Done";
?>
The above describes the Dedecms picture template moving easy data into the dedecms PHP program, including the Dedecms picture template aspects, I hope that the PHP tutorial interested in a friend helpful.