当我们的数据库不在本地时,需要通过程序来实施更新,可以采用下面的方法。
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
</head>
<body>
</body>
<!-- #include file="../includes/conn.asp" -->
</html>
20061204数据库更新:增加数据库表的字段<br>
<%
sql="ALTER TABLE Tab_Activitysign ADD sign_time datetime NULL "
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
</head>
<body>
</body>
<!-- #include file="../includes/conn.asp" -->
</html>
20061204数据库更新:增加数据库表的字段<br>
<%
sql="ALTER TABLE Tab_Activitysign ADD sign_time datetime NULL "
conn.execute(sql)
If Err Then
Response.Write TableTop & "更新Tab_Activitysign表<font color=blue>失败</font>,原因:" & Err.Description & "<BR>" & TableEnd
Err.Clear
Response.Flush
Else
Response.Write TableTop & "更新Tab_Activitysign成功<BR>" & TableEnd
Response.Flush
End If
conn.close
set conn=nothing
%>
If Err Then
Response.Write TableTop & "更新Tab_Activitysign表<font color=blue>失败</font>,原因:" & Err.Description & "<BR>" & TableEnd
Err.Clear
Response.Flush
Else
Response.Write TableTop & "更新Tab_Activitysign成功<BR>" & TableEnd
Response.Flush
End If
conn.close
set conn=nothing
%>
本文转自 simeon2005 51CTO博客,原文链接:http://blog.51cto.com/simeon/11478