VBS查询数据库然后写入到文本文件




TextExportFile = "sExportFile.txt"

Set cn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")

cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=FILENAME.mdb; jet oledb:database password=abcdef"
‘Here the strSQL can be a SQL sentense or a Stored procedure
strSQL = "execute psv_main_clone"

rs.Open strSQL, cn, 3, 3

Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.CreateTextFile(TextExportFile, True)
a = rs.GetString

f.WriteLine a
f.Close


VBS查询数据库然后写入到文本文件,布布扣,bubuko.com

VBS查询数据库然后写入到文本文件

上一篇:Oracle DG 之逻辑备库--Switchover


下一篇:PHP 图片的二进制存取 (Mysql)