File handling:
Writing Values From a File:
Const ForReading = 1, ForWriting = 2
Dim fso, MyFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.OpenTextFile("c:\testfile.txt", ForWriting, True)
MyFile.WriteLine "Hello world!"
MyFile.WriteLine "The quick brown fox"
MyFile.Close
Reading Values from a File:
Const ForReading = 1, ForWriting = 2
Dim fso, MyFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.OpenTextFile("c:\testfile.txt", ForReading)
Val= MyFile.ReadLine
Val1=MyFile.ReadLine
MyFile.Close
Fetching Values from a Database using VBScript.
Set MyConn = CreateObject("ADODB.Connection")
MyConn.Open"Provider=Microsoft.Jet.OLEDB.4.0;DataSource=C:\Program”+_ "Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight32.mdb"
Set RS = MyConn.Execute("SELECT * FROM Orders")
While Not RS.EOF
msgbox RS("Order_Number").Value
Rs.MoveNext
Wend
No comments:
Post a Comment
I welcome your comment, will respond and post it at the earliest:)