Asp > SQL
Delete Unwanted Email Addreses
Delete Unwanted Email Addreses <%@Language="vbscript" %> <% Const adOpenForwardOnly = 0 Const adLockReadOnly = 1 Const adCmdText = &H0001 Const adUseClient = 3 If Request.QueryString("md") = "dl" And Request.Form("sAddress") <> "" And Request.Form("dbName") <> "" Then DSNName = Request.Form("dbName") & ".mdb" Set Con = Server.CreateObject("ADODB.Connection") Con.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath(DSNName) strAddresses = Request.Form("sAddress") splitAddress = Split(strAddresses, ",") Set Table = Con.OpenSchema (20) Do While Not Table.EOF TblName = Table("Table_Name") 'The condition below excludes the system tables from beeing processed If UCase(Left(TblName,4)) <> "MSYS" And UCase(Left(TblName,3)) <> "SYS" And UCase(Left(TblName,4)) <> "RTBL" Then strSQL = "SELECT * FROM " & TblName Set rs = Server.CreateObject("ADODB.Recordset") rs.CursorLocation = adUseClient rs.Open (strSQL), Con, adOpenForwardOnly, adLockReadOnly, adCmdText For Each fldName In rs.Fields If fldName.Name = "EMail" Then For i = 0 To UBound(splitAddress) oneAddress = Trim(splitAddress(i)) strSQL = "DELETE FROM " & TblName & " WHERE EMail = '" & oneAddress & "'" Con.Execute(strSQL) Next End If Next rs.Close Set rs = Nothing End If Table.MoveNext Loop Con.Close Set Con = Nothing End If %>
Delete Multiple Addresses
Delete Multiple Addresses
Database Name:
.mdb
Paste all unwanted addresses into the textarea below, separated by a comma
,
Note:
This action will delete the selected addresses from all tables of the selected database.
This file must be located In the same folder of the database.
Asp Codes
ActiveX
ADO
Array
Code Snippets
Components
Data Access
Date Time
Files
Graphics
HTML Formatting
Mathematics
Miscellaneous
Sessions
SQL
Strings
Techniques
XML