PS:这个可以举一反三,如新云或NB等asp文章系统都可转为dedecms或其它php的cms
复制代码 代码如下:
<?php
//读取mdb数据库例程
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);
$conn2 = mysql_connect("localhost","root","");
mysql_select_db("dede",$conn2);
mysql_query("SET NAMES GBK",$conn2);
$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;
$sql0 = "select ID from dede_archives where ID='$id'";
$rs0 = mysql_query($sql0,$conn2);
$row = mysql_fetch_array($rs0);
if(intval($row['ID'])==0){
$sql1 = "insert into dede_archives (ID,typeid,channel,title,sortrank,pubdate,senddate,adminID,keywords) values ('$id','$classid',1,'$title','$time','$time','$time',1,'$keyword')";
$rs1 = mysql_query($sql1,$conn2);
if(!$rs1){
echo $sql1;
echo "<br>";
echo mysql_error();
echo "<br>";
//exit;
}
$id2 = mysql_insert_id();
if($id2>0){
$sql2 = "insert into dede_addonarticle (aid ,typeid, body ) values('$id','$classid','$content');";
$rs2 = mysql_query($sql2,$conn2);
if(!$rs2){
echo $sql2;
echo "<br>";
echo mysql_error();
echo "<br>";
//exit;
}
}
}
$rs->MoveNext();
$i++;
if($i%50==0)sleep(5);
}
echo "完成";
?>
复制代码 代码如下:
<?php
//读取mdb数据库例程
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);
$conn2 = mysql_connect("localhost","root","");
mysql_select_db("dede",$conn2);
mysql_query("SET NAMES GBK",$conn2);
$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;
$sql0 = "select ID from dede_archives where ID='$id'";
$rs0 = mysql_query($sql0,$conn2);
$row = mysql_fetch_array($rs0);
if(intval($row['ID'])==0){
$sql1 = "insert into dede_archives (ID,typeid,channel,title,sortrank,pubdate,senddate,adminID,keywords) values ('$id','$classid',1,'$title','$time','$time','$time',1,'$keyword')";
$rs1 = mysql_query($sql1,$conn2);
if(!$rs1){
echo $sql1;
echo "<br>";
echo mysql_error();
echo "<br>";
//exit;
}
$id2 = mysql_insert_id();
if($id2>0){
$sql2 = "insert into dede_addonarticle (aid ,typeid, body ) values('$id','$classid','$content');";
$rs2 = mysql_query($sql2,$conn2);
if(!$rs2){
echo $sql2;
echo "<br>";
echo mysql_error();
echo "<br>";
//exit;
}
}
}
$rs->MoveNext();
$i++;
if($i%50==0)sleep(5);
}
echo "完成";
?>
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
桃源资源网 Design By www.nqtax.com
暂无“动易数据转成dedecms的php程序”评论...
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。