K
Kamarul
Hi,
i'm looking for script that can Export Microsofts Access queries to tab
delimited files.
i'm really new in scripting and dont have any idea on how to create a
script on this.
i've found this script (below) in the group, when i tested it, its run
OK, but the output is in csv format.
i need it to be in Tab Delimited text with field headers on 1st row and
without any quote.
Really appreciate if anyone would like to help me on this.
Thank you and Thanks in advance.
'Modify DB_NAME, QRY_NAME, DATA_DESTINATION as required
Option Explicit
Dim oJet 'As DAO.DBEngine
Dim oDB 'As DAO.Database
Dim oTDef 'As DAO.TableDef
Dim strSQL 'As String
Const DB_NAME = "D:\Documents and Settings\TEST\TEST.mdb"
Const QRY_NAME = "TESTQRY" 'Query or table to export
'Next line specifies the folder and file for export.
'This example specifies C:\Temp\MyFile.txt
Const DATA_DESTINATION = "[Text;HDR=Yes;Database=C:\Temp\;].MyFile#csv"
Set oJet = CreateObject("DAO.DBEngine.36")
Set oDB = oJet.OpenDatabase(DB_NAME)
strSQL = "SELECT * INTO " & DATA_DESTINATION _
& " FROM " & QRY_NAME & ";"
wscript.echo strSQL
oDB.Execute strSQL
oDB.Close
'END
i'm looking for script that can Export Microsofts Access queries to tab
delimited files.
i'm really new in scripting and dont have any idea on how to create a
script on this.
i've found this script (below) in the group, when i tested it, its run
OK, but the output is in csv format.
i need it to be in Tab Delimited text with field headers on 1st row and
without any quote.
Really appreciate if anyone would like to help me on this.
Thank you and Thanks in advance.
'Modify DB_NAME, QRY_NAME, DATA_DESTINATION as required
Option Explicit
Dim oJet 'As DAO.DBEngine
Dim oDB 'As DAO.Database
Dim oTDef 'As DAO.TableDef
Dim strSQL 'As String
Const DB_NAME = "D:\Documents and Settings\TEST\TEST.mdb"
Const QRY_NAME = "TESTQRY" 'Query or table to export
'Next line specifies the folder and file for export.
'This example specifies C:\Temp\MyFile.txt
Const DATA_DESTINATION = "[Text;HDR=Yes;Database=C:\Temp\;].MyFile#csv"
Set oJet = CreateObject("DAO.DBEngine.36")
Set oDB = oJet.OpenDatabase(DB_NAME)
strSQL = "SELECT * INTO " & DATA_DESTINATION _
& " FROM " & QRY_NAME & ";"
wscript.echo strSQL
oDB.Execute strSQL
oDB.Close
'END