在线数据库管理工具(db007) v1.5(2)
ACCESS
<input disabled="disabled" type="radio" name="dbtype" value="sql" onClick="dbstr.value='driver={SQL Server};database=;Server=;uid=;pwd='">
SQL<br><br>
连接字符:<input name="dbstr" type="text" id="dbstr" size="120" value="Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Password=;Data Source=<%=server.mappath("/")&"\"%>">
<input type="submit" name="Submit" value="连接" /><br><br>
注:access请使用绝对路径,本文件路径:<%=server.MapPath("db007.asp")%>
</form>
<form name="createdatabase" method="post" action="?key=createdatabase">
<font color=red>创建数据库:</font>路径
<input name="dataname" type="text" value="<%=server.MapPath("/")&"\database.mdb"%>" size="100">
<input type="submit" name="Submit" value="创建">
</form>
<%
response.End()
end if
'==================================================================建库
sub createdatabase()
dim DBName,dbstr,myCat
on error resume next
DBName = request("dataname")
dbstr = "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & DBName
Set myCat = Server.CreateObject( "ADOX.Catalog" )
myCat.Create dbstr
if err <> 0 then
response.write err.description
session("dbtype") = ""
session("dbstr") = ""
response.write "<input type='button' name='ok' value=' 返 回 ' onClick='javascript:history.go(-1)'>"
response.end
end if
session("dbtype") = "access"
session("dbstr") = dbstr
response.redirect "?"
内容版权声明:除非注明,否则皆为本站原创文章。