ASP做查询分析器(Query Analyzer)(V)

查询分析

DataTypeLib.asp

<%
Function selectIdentity(strConnect,strTable,strColumn)
Dim objConn, objRS, strFieldName, strFieldType, arrData, intRowCounter, intColCounter, strFieldValue
Dim intUBoundRow, intUBoundCol, strSQLID
Set objConn=Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = strConnect
objConn.Open
strSQLID = "SELECT COLUMNPROPERTY( OBJECT_ID('"&strTable&"'),'"&strColumn&"','IsIdentity')"
Set objRS = objConn.Execute(strSQLID)
        If objRS.EOF and objRS.BOF then
            Response.Write("No records matched or table is empty")
            objRS.Close
            Set objRS = Nothing
            objconn.Close
            Set objconn=Nothing
        Else
            ' Now lets grab all the records and close objects
            arrData=objRS.Getrows
            objRS.Close
            Set objRS = Nothing
            objConn.Close
            Set objConn = Nothing
            
            intUBoundRow = UBound(arrData,2)
            intUBoundCol = UBound(arrData,1)
            For intRowCounter = 0 to intUBoundRow
                For intColCounter = 0 to intUBoundCol
                    strFieldValue = arrdata(intcolcounter,introwcounter)
                    If isNull(strFieldValue) then
                        strFieldValue ="<NULL>"
                    Elseif trim(strFieldValue)="" then
                        strFieldValue="<BLANK>"
                    End if
                Next
            Next
        End if
    selectIdentity = strFieldValue
End Function

Sub getIdentity(strServer, xdbname, xuserid, xpassword)

dim cnn, cat, tbl, fld, strCookieIdentity
dim connectstring
  connectstring = _
                "Provider=SQLOLEDB.1;Data Source="&strServer&";" & _
                "Initial Catalog=" & xdbname & _
                ";UID=" & xuserid & ";PWD=" & xpassword & ";"
        
  set cnn = server.createobject("adodb.connection")
  set cat = server.createobject("adox.catalog")
  set tbl = server.createobject("adox.table")
  set fld = server.createobject("adox.column")
  
  cnn.Open connectstring
  
  cat.ActiveConnection = cnn
  

时间: 2024-09-20 00:34:59

ASP做查询分析器(Query Analyzer)(V)的相关文章

ASP做查询分析器(Query Analyzer)(III)

查询分析 sqlultimate.asp--Part C <html><head><title>BuildSQL</title><!--#include file="DataTypeLib.asp" -->     <script language="JavaScript1.2" type="text/javascript"> <!--    function addF

ASP做查询分析器(Query Analyzer)(IV)

查询分析 createTable.asp <%@ LANGUAGE = VBScript %><% Option ExplicitResponse.Buffer = TrueResponse.ContentType = "text/html; charset=iso-8859-1" '--------------------------------------------------------------'--- Declarations'-------------

ASP做查询分析器(Query Analyzer)(I)

查询分析 sqlultimate.asp--Part A <%@ LANGUAGE = VBScript %><% Option ExplicitResponse.Buffer = TrueSession.Timeout = 1 Response.ContentType = "text/html; charset=iso-8859-1" '--------------------------------------------------------------'--

ASP做查询分析器(Query Analyzer)(II)

查询分析 sqlultimate.asp--Part B '   ++++++++++++++   FK Sub  +++++++++++++++++SUB FK(xdbname, xuserid, xpassword )Dim strConn,conntemp,rsSchema,PKT,PKC,FKT,FKCConst adSchemaForeignKeys = 27strConn =  "Provider=SQLOLEDB.1;Data Source="&strServer

使用查询分析器调整SQL服务器脚本

查询分析|服务器|脚本 我喜欢把SQL服务器所捆绑的工具看作是倒金字塔型的,诊断和检查一般问题的工具在顶端,寻找和诊断问题具体区域的工具在底部.除了提供一种编写SQL脚本的便捷方式之外,在你需要解决特定SQL脚本里明确问题的时候,查询分析器(Query Analyzer)还是所需要使用的资源.如果你需要指出哪个查询正在保持着某个特定表格的锁定状态,你也会希望使用查询分析器. 查询分析器的关键诊断特性是它能够显示某个查询的执行计划.这个执行计划会向你提供各种类型的有用信息,例如在查询的执行期间如何

使用查询分析器调整SQL服务器

我喜欢把SQL服务器所捆绑的工具看作是倒金字塔型的,诊断和检查一般问题的工具在顶端,寻找和诊断问题具体区域的工具在底部.除了提供一种编写SQL脚本的便捷方式之外,在你需要解决特定SQL脚本里明确问题的时候,查询分析器(Query Analyzer)还是所需要使用的资源.如果你需要指出哪个查询正在保持着某个特定表格的锁定状态,你也会希望使用查询分析器.查询分析器的关键诊断特性是它能够显示某个查询的执行计划.这个执行计划会向你提供各种类型的有用信息,例如在查询的执行期间如何以及何时使用或者不使用索引

SQL Query Analyzer

19.3.1 SQL Query Analyzer 简介    SQL Query Analyzer 是一个图形化的管理工具,主要用于编写.测试Transact-SQL 语句.批处理.系统管理员和开发者通过SQL Query Analyzer 能够同时执行多个查询.查看查询结果.分析查询计划,从而了解如何提高查询执行的性能.从SQL Server Enterprise Manager 可以将其启动.SQL Query Analyzer 提供了以下特性: 为编写Transact-SQL 语句提供了

数据库的Query Analyzer

数据|数据库 很多人一定用过Query Analyzer,这个工具的功能如何如何,就不用我说了,这次给大家介绍下Web下的Query Analyzer,界面如图1,使用ASP写的. (图1) 源程序如下: <%dim conn dim connstr on error resume nextif request("selectdb")="mdb" thenif request("dbname")<>"" th

响应式设计的思考:媒体查询(media query)

文章简介:媒体查询与http请求 Jason Grigsby发表了篇文章,<CSS Media Query for Mobile is Fool's Gold>对媒体查询(media query)吐槽,大意是在移动设备上使用媒体查询会造成很多资源的浪费--浏览器请求到很多用不到的图片等资源,然后写了一些测试用例测试一些可用方法.然后Tim Kadlec写了篇<Media Query & Asset Downloading Results>,用js自动化的测试了Jason G