ASP 辅助工具(hta版)(asp使用的脚本语言)学到了

随心笔谈12个月前发布 admin
109 0

transitional.dtd”>

ASP辅助工具

ID=”ASPTools”

APPLICATIONNAME=”ASPTools”

SCROLL=”no”

SINGLEINSTANCE=”yes”

WINDOWSTATE=”normal”

>

IP:

登录名:

密码:

数据库名:

(‘MSSQL’)” value=”连接SQL数据库” />

green” />

    模板:

–通用建表结构

Create Table [dbo].[tablename] (

[ID] int primary key identity(1,1),–ID,主键,自动号

[txtTitle] varchar(255),–标题

[txtContent] text,–内容

[PutTime] datetime Default (getdate()),–提交时间

[ModiTime] datetime Default (getdate()),–修改时间

[Hits] int Default (0),–点击数

[Flags] int Default (0) ,–标识

[OrderID] int Default (0),–排序号

)

UserName

Password

Sex

TrueName

Age

Tel

MSN

QQ

Email

辅助输入

rs(“$1”)=Request(“$1”)

rs(“$1”)=SafeRequest(“$1”)

$1=Request(“$1”)

$1=SafeRequest(“$1”)

$1:

建议查看源文件然后保存为ASPTools.hta然后再运行

self.Focus()

self.ResizeTo 620, 520

‘初始化数据

s.Value=sDemo.innerHTML

fzs=Split(fzDemo.innerHTML, vbCrLf)

For Each optTemp In fzs

Set o=document.createElement(“Option”)

o.text=optTemp

o.Value=optTemp

fz.Add o

Next

opt.Value=fz.options(1).Value

‘程序运行时的一些函数

Function c()

ss=Split(s.Value, vbCrLf)

For Each sss in ss

If sss<>”” Then Str=Str & Replace(opt.Value, “$1”, sss) & vbCrLf

Next

d.Value=Str

End Function

Dim xCat ‘定义全局变量,避免重复链接数据库。

Function CreateTableSelect(dbType)

Set xCat=CreateObject(“ADOX.Catalog”)

If dbType=”ACCESS” Then

xCat.ActiveConnection=”Provider=Microsoft.Jet.OLEDB.4.0;Data Source=” & txtFile.Value

ElseIf dbType=”MSSQL” Then

xCat.ActiveConnection=”Provider=SQLOLEDB.1; Persist Security Info=True; Data Source=” & IP.Value & “;

Initial Catalog=”& dbname.Value &”; User ID=”& UserID.Value &”; Password=” & pwd.Value

End If

For Each xTable in xCat.Tables

tableType=xTable.Type

If tableType=”TABLE” Then

TablesS=TablesS & “

End If

Next

Tables.innerHTML=” 

表名==” & TablesS & “”

End Function

Function CreateFieldSelect(dbType)

Dim Item

For Each xTable in xCat.Tables

If xTable.Name=NowTables.Value Then

For Each Item in xTable.Columns

Str=Str + Item.Name & vbCrLf

Next

Exit For

End If

Next

s.Value=Left(Str, Len(Str) -2)

End Function

Function MadeSQL()

yongfa365Fields=Split(s.Value, vbCrLf)

yongfa365Code2=””

For Each sql in yongfa365Fields

If sql<>”” Then strSQL=strSQL & ” [” & sql & “] varchar(50),”

Next

strSQL=Left(strSQL, Len(strSQL) -1)

yongfa365Code2=”Create Table TableName(” & vbCrLf & Replace(strSQL, “,”, “,” & vbCrLf) & vbCrLf & “)” & vbCrLf

& vbCrLf

TempValue=Join(yongfa365Fields, ” & “”‘,'”” & objItem.”)

yongfa365Code2=yongfa365Code2 & “Conn.Execute “”insert into Info (” & Join(yongfa365Fields, “,”) & “) values

(‘”” & objItem.” & TempValue & ” & “”‘)””” & vbCrLf & vbCrLf & vbCrLf

TempValue=Join(yongfa365Fields, “””) & “”‘,'”” & rs(“””)

yongfa365Code2=yongfa365Code2 & “Conn.Execute “”insert into Info (” & Join(yongfa365Fields, “,”) & “) values

(‘”” & rs(“”” & TempValue & “””) & “”‘)””” & vbCrLf & vbCrLf & vbCrLf

TempValue=Join(yongfa365Fields, ” & “”‘,'”” & “)

yongfa365Code2=yongfa365Code2 & “Conn.Execute “”insert into Info (” & Join(yongfa365Fields, “,”) & “) values

(‘”” & ” & TempValue & ” & “”‘)””” & vbCrLf & vbCrLf & vbCrLf

d.Value=SQLDEMO.innerHTML & String(2, vbCrLf) & yongfa365Code2

End Function

Function reReplace(Str, restrS, restrD)

Set re=New RegExp

re.IgnoreCase=True

re.Global=True

re.Pattern=restrS

reReplace=re.Replace(Str, restrD)

End Function

© 版权声明

相关文章