%@ Language=VBScript %>
<% if Request("Action") = "ShowdB" then Set objConn = Server.CreateObject("ADODB.Connection") objConn.Open "Provider=SQLOLEDB; Data Source=martini; Initial Catalog=" & Request("dB") & "; User ID=UserID; Password=Password" strSQL = "SELECT name,length,xtype,isnullable FROM syscolumns WHERE id=" & Request("id") & " ORDER BY colorder ASC" Response.Write "" sSQL = "SELECT * FROM " & Trim(Request("Table")) 'Response.Write sSQL & "" Set sConn = Server.CreateObject("ADODB.Connection") sConn.Open "Provider=SQLOLEDB; Data Source=martini; Initial Catalog=" & Request("dB") & "; User ID=UserName; Password=Password" Set sRS = Server.CreateObject("ADODB.Recordset") sRS.Open sSQL, sConn Response.Write "
Copy & Paste:
" sFldString = "" Set RS = Nothing Set Conn = Nothing Response.Write "" & sFldString objConn.Close Set objConn = Nothing elseif Request("Action") = "Statement" then if Request("Type") = "Select" then sSQL = "SELECT " for each item in Request.Form if instr(1,Left(item,5),"field") then if i=0 then sFields = Request.Form(item) i=1 else sFields = sFields & "," & Request.Form(item) end if end if next sSQL = sSQL & sFields & " FROM " & Request("Table") Response.Write "" else sSQL = "INSERT INTO " & Request("Table") & "(" for each item in Request.Form if instr(1,Left(item,5),"field") then if i=0 then sFields = Request.Form(item) sValues = "'"" & Request(""" & Request.Form(item) & """) & ""'" i=1 else sFields = sFields & "," & Request.Form(item) sValues = sValues & ",'"" & Request(""" & Request.Form(item) & """) & ""'" end if end if next sSQL = sSQL & sFields & ") VALUES (" & sValues & ")""" Response.Write "" end if elseif Request("Action") = "ShowT" then Set objConn = Server.CreateObject("ADODB.Connection") objConn.Open "Provider=SQLOLEDB; Data Source=martini; Initial Catalog=" & Request("dB") & "; User ID=UserName; Password=Password" Dim strSQL strSQL = "SELECT id,name,crdate AS Create_Date FROM sysobjects WHERE xtype='U' ORDER BY name ASC" 'Response.Write strSQL Dim objRS Set objRS = objConn.Execute(strSQL) Response.Write "
" & fld.Name & " | " & vbCrLf end if Next Response.Write "|
---|---|
" & fld.Value & " | " & vbCrLf elseif fld.Name = "id" then 'do nothing else Response.Write "" & fld.Value & " | " & vbCrLf end if Next Response.Write "
" & dRS("name") & " |