I am attempting to write a vbs file to ADO connect to a database, return the results of a query and write out the recordset to a text file.
I subsequently want to print the text file to generic (text only) printers with no formatting.
I have written some (probably messy) code to connect and populate a recordset. I have tested this and I can echo out fields from the first record.
How do I now get this data out of an array in memory into a text file?
do until eof / rs.movefirst / movenext do not work (I believe due to the oConn parameters).
I believe that oRec.Fields(0) oRec.Fields(1) may help but I cant work out the exact syntax.
Any ideal people??
Dim oConn, oRec
Dim sQuote, sSQL
sConn="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=\\SERVER\database.mdb;"
Set oConn = CreateObject("ADODB.Connection")
Set oRec = CreateObject("ADODB.Recordset")
sQuote = Chr(39)
sSQL = "SELECT * FROM FIRELIST"
oRec.Open sSQL, oConn, 0, 1, 1
Thank you for your help