I have a vbscript that connects to an Access 2007 database, exports data from a query, and writes it to a text file. The text file is then downloaded onto our web proxy device, which is Linux-based.
Access adds a carriage return (cr) at the end of each record returned by the query. But the proxy device wants a line feed (lf).
How can I add a line feed after each record in the Access query? I don't see a place to add formatting like this in the Access 2007 query designer. Could I add it in the vbscript? I add vbCrlf's at the end of the category, but I need them at the end of each record returned by the query and I don't know how to do that.
Segment of the script:
Ay rites lolcode?
Access adds a carriage return (cr) at the end of each record returned by the query. But the proxy device wants a line feed (lf).
How can I add a line feed after each record in the Access query? I don't see a place to add formatting like this in the Access 2007 query designer. Could I add it in the vbscript? I add vbCrlf's at the end of the category, but I need them at the end of each record returned by the query and I don't know how to do that.
Segment of the script:
Code:
' Identify source database and target file for export'
db = "\\10.1.1.10\proxy-local.accdb"
TextExportFile = "\\10.1.1.10\proxy_list.txt"
Set cn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
' Identify Microsoft database provider for Access 2007'
cn.Open _
"Provider=Microsoft.ACE.OLEDB.12.0; " & _
"Data Source=" & db
' Run the query to select the nocache category from the Data table'
strSQL = "SELECT * FROM nocache"
rs.Open strSQL, cn, 3, 3
' Write the query output to a text file'
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.CreateTextFile(TextExportFile, True)
strHeader = "define category nocache"
a = strHeader & vbCrLf & rs.GetString & "end" & vbCrLf
f.WriteLine a
f.Close
Ay rites lolcode?