  <%data_path=""%>
  <!--#include file="database_type.asp"-->
 <%
 '============================数据库连接对象的建立=========================================== 
	Dim Acc_db
	 
	If Database_type=1 Then
		
		ConnStr="driver={SQL Server};server="&SqlLocalName&";uid="&SqlUsername&";pwd="&SqlPassword&";database="&SqlDatabaseName&";"		
	Else
		Acc_db="Database/WebsenElecommerce.asp"
		Acc_db=data_path&Acc_db                   'data_path为路径
		ConnStr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&Acc_db&"")
	End If
	      on error resume next
		Set conn = Server.CreateObject("ADODB.Connection")
		conn.commandtimeout=20
		conn.open ConnStr
	
	If Err.number>0 Then
		err.Clear
		Set Conn = Nothing
		Response.Write "<br><br><br><br><br><br><br><div align='center'>数据库连接出错!请检查连接数据库的参数及字符串设置是否正确！</div>"
		Response.End
	End If
	
 '============================================================================================	


  '①. 新建职业类别表：
  conn.execute "create   table  Websen_jobkind(id  int identity(1,1) primary key , kindname   varchar(50))"
  '②. 添加职业类别记录
  set rsk=server.CreateObject("adodb.recordset")
  sqlk="select  * from Websen_jobkind where kindname='企业工作类' " 
  rsk.open sqlk,conn,1,3
  if   rsk.eof then 
  rsk.addnew
  rsk("kindname")="企业工作类"
  rsk.update
  rsk.close
  end if
   set rsk1=server.CreateObject("adodb.recordset")
  sqlk1="select  * from Websen_jobkind where kindname='行业工作类'" 
  rsk1.open sqlk1,conn,1,3
  if   rsk1.eof then 
  rsk1.addnew
  rsk1("kindname")="行业工作类"
  rsk1.update
  rsk1.close
  end if
  '------------------------
 
 
 
  '③. 招聘信息表修改------------------------------------- 
  conn.execute "alter table Websen_work   add country varchar(20),Province varchar(20),city varchar(20), enddate datetime,shenhe int default 0,jobkind int default 0"
  datenow=date()
  conn.execute "update Websen_work set jobkind=1, shenhe=1,enddate='"&datenow&"'" 
  
  '----------------------------------------
  '④. 委托表修改--------------------------------------------
   conn.execute "alter table Websen_wt alter column Email varchar(50)"
   
   '-----------------------------------------------------
   
   '⑤. 新建人才求职注册协议表并添加内容----------------------------------------
   conn.execute "create  table  Websen_jobreg(id  int identity(1,1) primary key , regcontent   text)"
    
   set rsk2=server.CreateObject("adodb.recordset")
   sqlk2="select  * from Websen_jobreg where regcontent like '暂无数据！'" 
   rsk2.open sqlk2,conn,1,3
   if   rsk2.eof then 
   rsk2.addnew
   rsk2("regcontent")="暂无数据！"
   rsk2.update
   rsk2.close
   end if





   
   '------------------------------------------------ 
   
   
   '⑥. 新建人才表----------------------------------
	If Database_type=1 Then
  	 conn.execute "create   table  Websen_jobuser(id  int identity(1,1) primary key ,jobuser   varchar(30) , jobpass varchar(30), email varchar(50),truename varchar(20),sfcode varchar(50) ,borndate varchar(30),age varchar(5),sex varchar(5),country varchar(30),province varchar(30),city varchar(30),high varchar(10),weight varchar(10),ismarry varchar(5),addr varchar(100),xueli varchar(20),learnkind varchar(50),learnname varchar(50),leftschool varchar(100),leftdate varchar(30),zhicheng varchar(30),addtime datetime default getdate() ,jobkind  int default 0,jobzhiwei varchar(50),jobzhiwei2 varchar(50),jobaddr varchar(100),jobmoney varchar(10),des text ,jingyan text, contactperson varchar(16),post varchar(20),tel varchar(50),mobile varchar(50),othercontact varchar(100),homeurl varchar(50),jobtype varchar(20),hits int default 1,islock int default 0,tuijian int default 0)"
  else
  	 conn.execute "create   table  Websen_jobuser(id  int identity(1,1) primary key ,jobuser   varchar(30) , jobpass varchar(30), email varchar(50),truename varchar(20),sfcode varchar(50) ,borndate varchar(30),age varchar(5),sex varchar(5),country varchar(30),province varchar(30),city varchar(30),high varchar(10),weight varchar(10),ismarry varchar(5),addr varchar(100),xueli varchar(20),learnkind varchar(50),learnname varchar(50),leftschool varchar(100),leftdate varchar(30),zhicheng varchar(30),addtime datetime default  date() ,jobkind  int default 0,jobzhiwei varchar(20),jobzhiwei2 varchar(20),jobaddr varchar(100),jobmoney varchar(10),des text ,jingyan text, contactperson varchar(16),post varchar(20),tel varchar(50),mobile varchar(50),othercontact varchar(100),homeurl varchar(50),jobtype varchar(20),hits int default 1,islock int default 0,tuijian int default 0)"

  end if
  '-----------------------------
  
  
  '⑦. 求职者投放简历记录表-----------------------------
  conn.execute "create   table  Websen_joblist(id  int identity(1,1) primary key ,jobid int default 0,jobuserid int default 0,addtime datetime ,backinfo text,isdel int default 0)"
  
   '-----------------------------
  
   '⑨. 更新网站行业类别一级表添加排序字段-------------------------
    conn.execute "alter table Websen_Class_1 add   orderid  int default 0"
    conn.execute "update Websen_Class_1 set orderid=0"
    '-----------------------------------------------
    
   '⑩. 更新商机类别表添加排序字段-------------------------
     conn.execute "alter table Websen_vipinfo_class add   orderid  int default 0"
     conn.execute "update Websen_vipinfo_class set orderid=0"
  
    '-----------------------------------------------
   '⑾. 更新行业资讯类别表添加排序字段-------------------------
     conn.execute "alter table Websen_newsType add   orderid  int default 0"
     conn.execute "update Websen_newsType set orderid=0"
  
    '-----------------------------------------------   
     '⑿. 更新配置表添加是否允许游客查看联系信息字段和留言字段-------------------------
     conn.execute "alter table Websen_worldec_config add   issee  int default 0,iswrite int default 0"
     conn.execute "update Websen_worldec_config set issee=0,iswrite=0"
  
    '-----------------------------------------------   
     '⒀. 添加游客留言表-------------------------
     conn.execute "create   table  Yx_ykmessage(id  int identity(1,1) primary key ,gsid int default 0,title varchar(50),content text,seeflag int default 0,datemsg datetime )"
  
    '-----------------------------------------------   
	'⒁.修复友情连接的字段--------------------------  
    conn.execute "alter table Websen_link alter column imageurl varchar(150)"
    conn.execute "alter table Websen_link alter column siteurl varchar(150)"  
    '-----------------------------------------------   
	'⒂.添加产品报价字段-----------------------------------
     conn.execute "alter table Websen_productshow add   proprice  float default 0"
     conn.execute "update Websen_productshow set proprice=0"
  	'-------------------------------------------------------
    '-----------------------------------------------   
     '⒃. 更新配置表添加网站宽度字段-------------------------
     conn.execute "alter table Websen_worldec_config add   pagewidth  int default 778"
     conn.execute "update Websen_worldec_config set pagewidth=778"
  
    '-----------------------------------------------   
	
	
	if err then
	response.Write("你已经进行过数据表的升级操作了!<a href=# onclick='javascript:window.close();'>关闭</a>")
	response.End()
	else
	response.Write("数据库升级完成！&nbsp;")
	response.End()
	end if
%>