2008年3月27日 星期四
2008年3月21日 星期五
VB.NET 發信
Dim mailmsg As New System.Net.Mail.MailMessage
mailmsg.To.Add(New System.Net.Mail.MailAddress("maxx31@xx.com.tw", "助理"))
mailmsg.Bcc.Add(New System.Net.Mail.MailAddress("rowxx@xx.com.tw", "電腦"))
Dim smtp As New System.Net.Mail.SmtpClient
smtp.Host = "10.20.xx.2xx"
smtp.Send(mailmsg)
mailmsg.To.Add(New System.Net.Mail.MailAddress("maxx31@xx.com.tw", "助理"))
mailmsg.Bcc.Add(New System.Net.Mail.MailAddress("rowxx@xx.com.tw", "電腦"))
Dim smtp As New System.Net.Mail.SmtpClient
smtp.Host = "10.20.xx.2xx"
smtp.Send(mailmsg)
2008年3月20日 星期四
用Vbscript 改檔名
Set objFSO = CreateObject("Scripting.FileSystemObject")
SourceFile=Server.MapPath("c:/test.asp") '要改的原始檔
TargetFile=Server.MapPath("c:/test1.asp") '新的檔名
objFSO.MoveFile SourceFile, TargetFile
SourceFile=Server.MapPath("c:/test.asp") '要改的原始檔
TargetFile=Server.MapPath("c:/test1.asp") '新的檔名
objFSO.MoveFile SourceFile, TargetFile
在DTS中使用Activex 工作處理檔案--Copy
'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************
Function Main()
dim fs,strfullpath,f
set fs=createobject("Scripting.FileSystemObject")
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim f2
dim yyymm
Set f2 = fs.OpenTextFile("D:\SKBANK\BISsys\DATA\lnctbfy.dat", ForReading, True)
yyymm = f2.Read(5)
'Main=DTSTaskExecResult_Failure
fs.CopyFile "D:\SKBANK\BISsys\DATA\lnctbfy.dat", "D:\SKBANK\BISsys\DATA\"+yyymm+"lnctbfy.dat"
set fs=nothing
Main=DTSTaskExecResult_Success
End Function
' Visual Basic ActiveX Script
'************************************************************************
Function Main()
dim fs,strfullpath,f
set fs=createobject("Scripting.FileSystemObject")
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim f2
dim yyymm
Set f2 = fs.OpenTextFile("D:\SKBANK\BISsys\DATA\lnctbfy.dat", ForReading, True)
yyymm = f2.Read(5)
'Main=DTSTaskExecResult_Failure
fs.CopyFile "D:\SKBANK\BISsys\DATA\lnctbfy.dat", "D:\SKBANK\BISsys\DATA\"+yyymm+"lnctbfy.dat"
set fs=nothing
Main=DTSTaskExecResult_Success
End Function
在DTS中使用Activex 工作處理檔案
'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************
Function Main()
dim fs,strfullpath,f
set fs=createobject("Scripting.FileSystemObject")
if (fs Is Nothing) then
Main=DTSTaskExecResult_Failure
'msgbox "1"
exit function
end if
strfullpath="D:\SFBAFK\BISsys\DATA\lnctbtt.dat"
if not fs.fileexists(strfullpath) then
Main=DTSTaskExecResult_Failure
'msgbox "2"
set fs=nothing
exit function
end if
Set f = fs.GetFile(strfullpath)
if f.size =0 then
Main=DTSTaskExecResult_Failure
'msgbox ""
set fs=nothing
exit function
end if
set fs=nothing
'msgbox "4"
'Main=DTSTaskExecResult_Failure
Main=DTSTaskExecResult_Success
End Function
' Visual Basic ActiveX Script
'************************************************************************
Function Main()
dim fs,strfullpath,f
set fs=createobject("Scripting.FileSystemObject")
if (fs Is Nothing) then
Main=DTSTaskExecResult_Failure
'msgbox "1"
exit function
end if
strfullpath="D:\SFBAFK\BISsys\DATA\lnctbtt.dat"
if not fs.fileexists(strfullpath) then
Main=DTSTaskExecResult_Failure
'msgbox "2"
set fs=nothing
exit function
end if
Set f = fs.GetFile(strfullpath)
if f.size =0 then
Main=DTSTaskExecResult_Failure
'msgbox ""
set fs=nothing
exit function
end if
set fs=nothing
'msgbox "4"
'Main=DTSTaskExecResult_Failure
Main=DTSTaskExecResult_Success
End Function
在DTS中使用Active 工作執行DTS
'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************
Function Main()
dtsname="ImportBISTwd"
usrname="sa"
servername="MA03XXBXX"
pwd="sapwd"
DTSSQLStgFlag_Default2=0
dim objDTSPackage
dim objDTSStep
dim strResult
dim blnSucceeded
const DTSSQLStgFlag_Default = 0
const DTSStepExecResult_Failure = 1
set objDTSPackage = CreateObject("DTS.Package")
objDTSPackage.LoadFromSQLServer servername, usrname, pwd, DTSSQLStgFlag_Default2, "", "", "", dtsname
objDTSPackage.Execute
Main = DTSTaskExecResult_Success
End Function
' Visual Basic ActiveX Script
'************************************************************************
Function Main()
dtsname="ImportBISTwd"
usrname="sa"
servername="MA03XXBXX"
pwd="sapwd"
DTSSQLStgFlag_Default2=0
dim objDTSPackage
dim objDTSStep
dim strResult
dim blnSucceeded
const DTSSQLStgFlag_Default = 0
const DTSStepExecResult_Failure = 1
set objDTSPackage = CreateObject("DTS.Package")
objDTSPackage.LoadFromSQLServer servername, usrname, pwd, DTSSQLStgFlag_Default2, "", "", "", dtsname
objDTSPackage.Execute
Main = DTSTaskExecResult_Success
End Function
2008年3月17日 星期一
DROP TABLE
IF EXISTS(SELECT name FROM sysobjects WHERE name = N'CUST'
AND type = 'U')
DROP TABLE CUST
AND type = 'U')
DROP TABLE CUST
訂閱:
文章 (Atom)