Photo Gallery Member List Search Calendars FAQ Ticket List Log Out



How to export a SQL View to CSV using VBScript

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,46549
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> How to export a SQL View to CSV using VBScript
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 How to export a SQL View to CSV using VBScript - 5/2/2007 6:50:58 AM   
  VBNewbie07

 

Posts: 2
Score: 0
Joined: 5/2/2007
Status: offline
Hi all.

I would like to know if there is way to export a SQL View to a csv file using VBScript?

Thank you in advance!
 
 
Post #: 1
 
 RE: How to export a SQL View to CSV using VBScript - 5/2/2007 12:19:12 PM   
  dm_4ever


Posts: 3165
Score: 50
Joined: 6/29/2006
From: Orange County, California
Status: offline
Not certain, but you can export to a csv from an Access DB like this...


      

You might be able to modify this to export from an SQL server...not sure though...  You might also just query the Table using ADO and use the GetString method to format the data and write it out to a .csv file.

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to VBNewbie07)
 
 
Post #: 2
 
 RE: How to export a SQL View to CSV using VBScript - 5/2/2007 11:58:18 PM   
  VBNewbie07

 

Posts: 2
Score: 0
Joined: 5/2/2007
Status: offline
Thanks dm_4ever!

I'll give it a try.

(in reply to dm_4ever)
 
 
Post #: 3
 
 RE: How to export a SQL View to CSV using VBScript - 7/17/2007 2:03:57 PM   
  peachtea

 

Posts: 41
Score: 0
Joined: 7/5/2007
From: Singapore
Status: offline
hi there... just a qn to hijack this thread

is it possible for vb script to pick up certain information from 2 separate access tables and insert them into the 3rd table before export it out to a csv file?
All 3 tables r in the same db

Thanks in advance :)

(in reply to VBNewbie07)
 
 
Post #: 4
 
 RE: How to export a SQL View to CSV using VBScript - 7/17/2007 2:30:33 PM   
  dm_4ever


Posts: 3165
Score: 50
Joined: 6/29/2006
From: Orange County, California
Status: offline
I don't see why it wouldn't be possible with the right SQL query.

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to peachtea)
 
 
Post #: 5
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> How to export a SQL View to CSV using VBScript Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts