Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
  #1  
Old October 27th, 2003, 03:19 PM
namanan namanan is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 1 namanan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Wink Export Query Result in Visual Basic

I am developing an application in which I need to export the query result. I am using Visual Basic and MS Access. In Access when you right click on the Query and click on "Export..." it opens up the Export Dialogbox and here you have the option to export the result of the query to Access database, Excel sheet, text file or in many other formats.

What I want to do is to open the same query export dialogbox in my visual basic through programming. So that when the user clicks on the button the visual basic program would open up the dialogbox and let the user to save the result of the query in all those formats.

Any reply is appreciated.
Thanks.

Reply With Quote
  #2  
Old October 27th, 2003, 07:28 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,716 Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 1 Month 33 m 54 sec
Reputation Power: 688
I think all those export goodies are Access specific. I don't know of a VB6 equivalent.

Reply With Quote
  #3  
Old October 27th, 2003, 07:55 PM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via MSN to cleverpig
Export Access Tables to Excel Worksheet sample: Application uses DAO to list tables in Access database; you select one table at a time to export to new or existing excel workbook
http://www.freevbcode.com/source/export_excel.zip

Export Access Tables to Other Formats Using a SQL Statement sample:You can use a Common Dialog control placed on a form somewhere to use this, or set opnFilename to the complete path and filename with extension. Also you will need to have Microsoft DAO 3.51 or 3.6 referenced. From what I have seen and used so far, the table name must not have spaces in it to do this. I personally just temporarily renamed the table and then used it.

'declare
Dim opnFileName As String
Dim strTempStr As String
Dim tableName As String
Dim intFileSep As Integer
Dim DatabaseName As Database

'code
For intFileSep = Len(opnFileName) To 1 Step -1
If Mid$(opnFileName, intFileSep, 1) = "\" Then Exit For
Next intFileSep

strTempStr = "SELECT * INTO [dBase IV;DATABASE=" + _
Left$(opnFileName, intFileSep - 1) + "].[" + _
Left$(Right$(opnFileName, Len(opnFileName) - intFileSep), _
Len(Right$(opnFileName, Len(opnFileName) - intFileSep)) - _
4) + "]" & " FROM ["& tableName &"]"

DatabaseName.Execute strTempStr

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Export Query Result in Visual Basic


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway