Login | |
|
 |
RE: ADO RECORDSETS - 3/2/2006 11:53:49 PM
|
|
 |
|
| |
ginolard
Posts: 1082
Score: 21
Joined: 8/10/2005
Status: offline
|
It would be easier if you posted some code but if I understand correctly you just wish to read each record and have that record as a single line in a CSV file? That's easy enough. Here's a rough example - I've not included the SQL connection code as I presume you aready have this Set rs=CreateObject("ADODB.recordset") rs.CursorLocation=3 ' adUseClient rs.CursorType=1 ' adOpenKeyset rs.LockType=3 ' adLockOptimistic rs.Open "Select * from table, conn Do Until RS.Eof strcsv=strcsv & rs(0) & "," & rs(1) & "," & rs(2) & "," & rs(3) & "," & rs(4) & "," & rs(5) & vbcrlf rs.MoveNext Loop Then write strcsv to a file.
_____________________________
Author of ManagePC - http://managepc.net AD Query Template - http://www.visualbasicscript.com/m_40609/tm.htm Consolidated Scripting Framework - http://www.visualbasicscript.com/m_59109/tm.htm
|
|
| |
|
|
|
 |
RE: ADO RECORDSETS - 3/3/2006 1:44:28 AM
|
|
 |
|
| |
Country73
Posts: 735
Score: 10
Status: offline
|
Just wanted to add a little information to what ginolard has posted. When writing to a CSV file the "," is what is used to tab to the next cell.
|
|
| |
|
|
|
 |
RE: ADO RECORDSETS - 3/7/2006 7:54:27 PM
|
|
 |
|
| |
ginolard
Posts: 1082
Score: 21
Joined: 8/10/2005
Status: offline
|
Ok, let's explain the two methods. For the sake of argument, I will assume that the date/time field is RS(1) SPLIT METHOD DateTimeArray=Split(RS(1)," ") Wscript.echo DateTimeArray(0) WScript.echo DateTimeArray(1) & " " & DateTimeArray(2) STRING MANIPULATION METHOD Wscript.echo Left(RS(1),InStr(mydate," ")) WScript.echo Trim(Mid(RS(1),InStr(mydate," ")))
_____________________________
Author of ManagePC - http://managepc.net AD Query Template - http://www.visualbasicscript.com/m_40609/tm.htm Consolidated Scripting Framework - http://www.visualbasicscript.com/m_59109/tm.htm
|
|
| |
|
|
|
|
|