📄 mod.asp
字号:
</tr>
<tr>
<td class=navcontent><B>Field</td>
<td class=navcontent><B>Type</td>
<td class=navcontent><B>Value</td>
</tr>
<%
counter = 0
while not rsInsert.EOF
counter = counter + 1
%>
<tr>
<td<%if counter mod 2="0" then%> bgcolor=white<%end if%> class=navcontent><%=rsInsert("field")%></td>
<td<%if counter mod 2="0" then%> bgcolor=white<%end if%> class=navcontent><%=rsInsert("type")%></td>
<td<%if counter mod 2="0" then%> bgcolor=white<%end if%>>
<%
if instr(rsInsert("type"), "enum(") > 0 then
%>
<select NAME="<%=rsInsert("field")%>" style="width:255px;">
<%
'Enum Datatype
strOptions = replace(rsInsert("type"), "enum(", "")
strOptions = replace(strOptions, ")", "")
aryOptions = split(strOptions, ",", -1)
for each x in aryOptions
%>
<option VALUE="<%=replace(x, "'", "")%>"><%=replace(x, "'", "")%></option>
<%
next
%>
</select>
<%
elseif instr(rsInsert("type"), "text") > 0 then
%>
<TEXTAREA name="<%=rsInsert("field")%>" style="width:255px;height:75px;" id=textarea1></TEXTAREA>
<%
else
%>
<input TYPE="text" style="width:255px;" Name="<%=rsInsert("field")%>" <%if rsInsert("extra") = "auto_increment" then%> readonly<%end if%>>
<%
end if
%>
</td>
</tr>
<%
rsInsert.MoveNext
wend
%>
<tr>
<td colspan="3"><input TYPE="SUBMIT" VALUE="Insert Row" name="AnsolButton"></td>
</tr>
</table>
</form>
<%
set rsInsert = nothing
else
%>
<table cellpadding="2" cellspacing="1" border="0" style="border:solid black 1pt;">
<tr>
<td bgcolor="#339999" colspan="3" class="cellsmalltitle" align="center">Insert Row Into <%=request("table")%></td>
</tr>
<tr>
<td class="smallcellcontent">
An Error Has Occured:<br><br>
<%=err.number%><br>
<%=err.Description%><br>
<%=err.Source%><br>
</td>
</tr>
</table>
<%
end if
else
'Actually insert the record
sql = "insert into " & request("db") & "." & request("table") & " ("
sql1 = " VALUES ("
for each x in Request.Form
if x <> "AnsolButton" then
sql = sql & x & ","
if len(request.form(x)) = 0 then
sql1 = sql1 & "NULL,"
else
if isDate(request.form(x)) then
sql1 = sql1 & "'" & year(request.form(x)) & "-" & month(request.form(x)) & "-" & day(request.form(x)) & "',"
else
sql1 = sql1 & "'" & replace(Request.Form(x), "'", "\'") & "',"
end if
end if
end if
next
sql= left(sql, len(sql) - 1) & ")"
sql1 = left(sql1, len(sql1) - 1) & ")"
sql = sql & sql1
set cn = server.CreateObject("ADODB.Connection")
cn.open dsn
cn.execute sql
if err.number = 0 then
set cn = nothing
Response.Clear
Response.Redirect "showdb.asp?db=" & request("db")
else
%>
<table cellpadding="2" cellspacing="1" border="0" style="border:solid black 1pt;">
<tr>
<td bgcolor="#339999" colspan="3" class="cellsmalltitle" align="center">Insert Row Into <%=request("table")%></td>
</tr>
<tr>
<td class="smallcellcontent">
An Error Has Occured:<br><br>
<%=err.number%><br>
<%=err.Description%><br>
<%=err.Source%><br>
</td>
</tr>
</table>
<%
end if
end if
case "properties"
set rsProps = server.CreateObject("ADODB.Recordset")
rsProps.CursorLocation = 1
rsProps.Open "show columns from " & request("db") & "." & request("table"), dsn, 2, 3
%>
<table cellpadding="2" cellspacing="1" border="0" style="border:solid black 1pt;">
<tr>
<td bgcolor="#339999" colspan="<%=rsProps.Fields.count + 5%>" class="cellsmalltitle" align="center">Table Properties -- <%=request("db") & "." & request("table")%></td>
</tr>
<tr>
<td class="cellsmallcontent">
<b> </b>
</td>
<td class="cellsmallcontent">
<b> </b>
</td>
<td class="cellsmallcontent">
<b> </b>
</td>
<td class="cellsmallcontent">
<b> </b>
</td>
<td class="cellsmallcontent">
<b> </b>
</td>
<td class="cellsmallcontent">
<b> </b>
</td>
<td class="cellsmallcontent" colspan="5" align="center">
<b>Actions</b>
</td>
</tr>
<tr>
<td bgcolor="#339999" class="cellsmalltitle">Field</td>
<td bgcolor="#339999" class="cellsmalltitle">Type</td>
<td bgcolor="#339999" class="CellSmallTitle" align="center">Attributes</b>
<td bgcolor="#339999" class="CellSmallTitle" align="center">Null</td>
<td bgcolor="#339999" class="CellSmallTitle" align="center">Default</td>
<td bgcolor="#339999" class="CellSmallTitle" align="center">Extra</td>
<td bgcolor="#339999" class="tinytitle" align="center">Change</td>
<td bgcolor="#339999" class="tinytitle" align="center">Drop</td>
<td bgcolor="#339999" class="tinytitle" align="center">Primary</td>
<td bgcolor="#339999" class="tinytitle" align="center">Index</td>
<td bgcolor="#339999" class="tinytitle" align="center">Unique</td>
</tr>
<%
i = 0
set rsKeys = server.CreateObject("ADODB.Recordset")
rsKeys.CursorLocation = 3
rsKeys.Open "show create table " & request("db") & "." & request("table"), dsn, 2, 3
vStr = rsKeys(1)
vStr = right(vStr, len(vStr) - instr(vStr, "PRIMARY KEY") + 1)
vStr = left(vStr, len(vStr) - (len(vStr) - instr(vStr, " TYPE=")))
vKeys = split(vStr, "),", -1)
for each x in vKeys
If InStr(x, "PRIMARY KEY") > 0 then
x = replace(x, "`", "")
x = replace(x, "PRIMARY KEY (", "")
pKey = x
end if
if InStr(x, "UNIQUE KEY") > 0 then
x = replace(x, "`", "")
x = replace(x, "UNIQUE KEY (", "")
uKey = x
End If
next
set rsKeys = nothing
while not rsProps.EOF
%>
<tr<% if i mod 2="0" then%> bgcolor="white"<%end if%>>
<td class="cellsmallcontent" nowrap>
<%=rsProps("field")%>
</td>
<td class="cellsmallcontent" nowrap>
<%=rsProps("type")%>
</td>
<td class="cellsmallcontent" nowrap>
<%'=rsProps("Attributes")%>
</td>
<td class="cellsmallcontent" nowrap>
<%=rsProps("Null")%>
</td>
<td class="cellsmallcontent" nowrap>
<%=rsProps("Default")%>
</td>
<td class="cellsmallcontent" nowrap>
<%=rsProps("extra")%>
</td>
<td class="cellsmallcontent" nowrap align="center">
<a href="altertable.asp?db=<%=request("db")%>&tb=<%=request("table")%>&col=<%=rsProps("field")%>&action=change"><img SRC="images/properties.gif" border="0" WIDTH="16" HEIGHT="16"></a>
</td>
<td class="cellsmallcontent" nowrap align="center">
<a href="runquery.asp?db=<%=request("db")%>&tb=<%=request("table")%>&vQuery=<%=server.URLEncode("alter table `" & request("table") & "` DROP `" & rsProps("field") & "`;")%>"><img SRC="images/deletex.gif" border="0" WIDTH="16" HEIGHT="16"></a>
</td>
<td class="cellsmallcontent" nowrap align="center">
<%if inStr(pKey, rsProps("field")) then%><img SRC="images/pkey.gif" WIDTH="16" HEIGHT="16"><%end if%>
</td>
<td class="cellsmallcontent" nowrap align="center">
</td>
<td class="cellsmallcontent" nowrap align="center">
<%if instr(uKey, rsProps("field")) then%><img src="images/Unique.gif" WIDTH="16" HEIGHT="16"><%end if%>
</td>
</tr>
<%
i = i + 1
rsProps.movenext
wend
%>
</table>
<br>
<table cellpadding="2" cellspacing="1" border="0" style="border:solid black 1pt;">
<tr>
<td bgcolor="#339999" class="cellsmalltitle" align="center">Add Column -- <%=request("db") & "." & request("table")%></td>
</tr>
<tr>
<td class="cellsmallcontent">
<a href="altertable.asp?db=<%=request("db")%>&tb=<%=request("table")%>&action=add" class="navlink">Add New Column</a>
</td>
</tr>
</table>
<%
end select
%>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!--#include file="bottom.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -