日期:2013-06-08  浏览次数:20947 次

sqlultimate.asp--Part A

<%@ LANGUAGE = VBScript %>
<%
Option Explicit
Response.Buffer = True
Session.Timeout = 1
Response.ContentType = "text/html; charset=iso-8859-1"

'--------------------------------------------------------------
'--- Declarations
'--------------------------------------------------------------

Dim strQueryType
Dim strClip                    ' String to display workspace
Dim strDB                    ' String to display relative database path
Dim strTable                ' String to hold the table name
Dim numTableValue
Dim strDBName
Dim strdbpath
Dim strConnect
Dim strSQL
Dim boolTableInfo
Dim strServer
Dim strUserID
Dim strPassword
Dim count
Dim intSpacer
Dim strIdentity
Dim strQuery
Dim strLoad
Dim strCreate
Dim strTableName
Dim strQOption,strQOption1,strQOption2,strQOption3

'--------------------------------------------------------------
'--- Initialization
'--------------------------------------------------------------

strTable = request("schema")

strClip = Trim(Request.Form("strClip"))

If request("selectdb") = "Select DB" Then
   strSQL = ""
Else
    strSQL = Trim(Request.Form("strSQL"))
    strSQL = replace(strSQL,vbCrLf,"")
    strClip = Trim(Request("strClip"))      ' get workspace values from form
End If

strLoad = request("Load")

If request("submitquery") = "Submit Query" Then
   strSQL = Trim(request("strSQL"))
   strSQL = replace(strSQL,vbCrLf,"")   
   strClip = Trim(Request("strClip"))       ' get workspace values from form
ElseIf strLoad = "Load" Then
   strSQL = request("strSQLLoad")
   strSQL = replace(strSQL,vbCrLf,"")     
End If   

strServer = request("sqlServer")

strUserID = request("log_in")

strPassword = request("user_password")

strDB = request("choosetable")

If request("tableinfo") = "Table Info" Then
   boolTableInfo = "True"
ElseIf request("saveMyQuery") = "Save" Then  
   booltableinfo = request("booltableinfo")
ElseIf request("createSQLStatement") = "Create" Then  
   booltableinfo = request("booltableinfo")
ElseIf request("Load") = "Load" Then  
   booltableinfo = request("booltableinfo")
ElseIf request("createTable") = "createTable" Then  
   booltableinfo = request("booltableinfo")         
End If     
    
strConnect = "Provider=SQLOLEDB.1;Password=" & strPassword & ";User ID=" & strUserID & ";Initial Catalog=" & strDB & ";Data Source=" & strServer & ";"

strIdentity = request.cookies(strDB & "strCookieIdentity")

strquery = request("sa