Link to home
Start Free TrialLog in
Avatar of davecocks
davecocks

asked on

Exporting Tables From .mdf file Visual Studio VB.NET

Hello experts,

I'm building an application thats linked to a .mdf file and I want to export the data out from one of the tables as a .csv file into a folder called Export Files in the current project path

I have some code I've used in Access and I'm trying to update it into VB.NET in Visual Studio 2008.

Any Ideas on how to change it, I'm having problems.

Thanks,
Dim getTables As String
 Dim csvName As String
 Dim BoatName As String
 
 'Copies the tblSurveys
 BoatName = Form!lblBoatName.Caption
 getTables = "tblSurveys"
 csvName = CurrentProject.Path & "\" & "Export Files\" & BoatName & getTables & ".csv"
   
 DoCmd.TransferText transfertype:=acExportDelim, _
   specificationname:="tblSurveys Export Specification", _
   tableName:=getTables, _
   filename:=csvName, _
   hasfieldnames:=True

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of aibusinesssolutions
aibusinesssolutions
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of davecocks
davecocks

ASKER

Hi Thanks for your help you put me on the right track.

I found another link with some suggestions if any one else needs some help.
http://www.daniweb.com/forums/thread67542.html