% '============================================================== ' TableEditoR 0.81 Beta ' http://www.2enetworx.com/dev/projects/tableeditor.asp '-------------------------------------------------------------- ' File: te_readDB.asp ' Description: Generate CSV file for te_showtable.asp (IE mode) ' Initiated By Hakan Eskici on Nov 07, 2000 '-------------------------------------------------------------- ' Copyright (c) 2002, 2eNetWorX/dev. ' ' TableEditoR is distributed with General Public License. ' Any derivatives of this software must remain OpenSource and ' must be distributed at no charge. ' (See license.txt for additional information) ' ' See Credits.txt for the list of contributors. ' ' Change Log: '-------------------------------------------------------------- ' # Mar 26, 2001 by Hakan Eskici ' Added support for automatic primary key detection ' Added support for multiple primary keys ' # Mar 28, 2001 by Hakan Eskici ' Modified the recordset paging control ' # Mar 29, 2001 by Hakan Eskici ' Added support for SQL Server boolean values ' Modified request's to .form or .querystring ' Added support for deleting multiple records ' # April 18, 2002 by Rami Kattan ' this file generate only CSV text file to be read by the ' te_showtable.asp and view the records '------------------------------------------------------------- Response.ContentType = "text/csv" ' Get the requested number of records per page cPerPage = CLng(request.QueryString("cPerPage")) If cPerPage = 0 or cPerPage= "" then cPerPage = iDefaultPerPage %> <% lConnID = request("cid") sTableName = request("tablename") sQuery = request("q") '------------------------------ 'added 8/10/01 by j.wilkinson, jwilkinson@mail.com 'added a check for nonAdmin users trying to view the admin table 'This is just checking that the connection ID = 0, assumes that 'non-admin users have no legitimate reason to get to that db at all. ' note that this may not protect against using queries to view ' this db and table if lConnID=0 and not bAdmin then response.end end if '------------------------------ const csvchar = "," if sQuery <> "" then bQuery = True sTableName = replace(sTableName, """", "'") end if function CheckData(inData) if not isnull(inData) then ' inData = replace(inData, vbCrLf, "") ' inData = replace(inData, vbCr, "") ' inData = replace(inData, vbLf, "") inData = replace(inData, "\", "\\") inData = replace(inData, ",", "\,") inData = replace(inData, ";", "\;") inData = replace(inData, "