Question:
How can I save a Database’s table in a text file?
Solution:
To do so, you can create a Report, configure a Query, and use the Export() method; or you can write the following script in the application:
set cs = Screen.Item(“Query1”).GetADORecordset()
table = cs.GetString(2, , , vbNewLine)
Set aux = CreateObject(“Scripting.FileSystemObject”)
table = cs.GetString(2, , , vbNewLine)
Set aux = CreateObject(“Scripting.FileSystemObject”)
Set aux1a = aux.CreateTextFile(“C:\Text1.txt”, True)
aux1a.Close
Set aux1 = aux.OpenTextFile(“C:\Text1.txt”,8)
aux1.WriteLine table
aux1.Close
aux1.WriteLine table
aux1.Close