<%
###########################################################################################################
'データベースコンテンツを置き換えます。ラムキング2005-8-22
'更新および修正:2006-6-28
'http://www.imbbs.cn qq:628557
'スペースドメイン名を販売しました。 Webページの制作。
###########################################################################################################
「さまざまな状況に変更を加えてください
const s1 = "admin" '交換する文字列
const s2 = "1234" 'は文字列に置き換えられました
const db = "lamking.mdb" 'データベース
const Ingrecase = true '無視ケース
「次のデータを変更する必要はありません
dim ors、ors2、conn、i
conn = server.createObject( "adodb.connection")を設定します
conn.open "プロバイダー= microsoft.jet.oledb.4.0; data source ="&server.mappath(db)
set ors = conn.openschema(20)
ors.eofではありません
ucase(ors( "table_type"))= "table"の場合、 'ユーザーテーブルの場合
'ループは、テーブルの各フィールドを置き換えます
ors2 = server.createObject( "adodb.recordset")を設定します
ors2.open "select * from ["&ors( "table_name")& "]"、conn、1,3
ors2.eofではありません
i = 0からors2.fields.count-1の場合
'OLEオブジェクトまたは自動番号付けフィールドの場合、交換されません
ors2(i).properties( "isautoincrement")= falseおよびors2(i).type <> 205 thenの場合
ors2(ors2(i).name)= myreplace(ors2(i).value)
ifを終了します
次
ors2.update
ors2.movenext
ループ
ors2.close
ORS2 =何も設定しません
ifを終了します
ors.movenext
ループ
close
ORS =何も設定しません
conn.close
conn =何も設定しません
response.write「交換が完了した」
機能myreplace(byval tstr)
薄暗いregex
tstr = ""またはisnull(tstr)の場合、機能を終了します
regex = new regexpを設定します
regex.global = true
regex.ignorecase = ingorecase
regex.multiline = true
regex.pattern = s1
myreplace = regex.replace(tstr、s2)
regex = Nothingを設定します
エンド関数
%>