|
-
September 19th, 2011, 12:09 PM
#1
Export data from Microsoft VB.Net to Excel or Access
Hi there, to get straight to it i've started work at this small charity and they need me to extract the tables and data from an old buggy system and create a new Access system but i'm having trouble extractig the data.
The backend uses Microsoft SQL Server 2000 runtime engine with an MSDE database engine. The frontend however is built with Microsoft VB.Net and the dotnet framework. I'm not sure how this changes things when trying to extract the tables. I've found the folders where SQL-notepad looking files are contained but am not sure what my next step should be. TBH i dont know what version of Microsoft VB.Net framework is used but the system is quite old and was made in 2001. If you haven't noticed from my poor phrasing i'm a bit of a newb when it comes to programming. If there is a particular programming code i have to put in i wouldn't really know where to put it. Any help/feedback you can give would be appreciated (even if its just to tell me im out of my depth!).
Thanks
Tony
-
September 19th, 2011, 01:00 PM
#2
Re: Export data from Microsoft VB.Net to Excel or Access
If it was made that long ago then it may not be .Net at all. If it is .Net then it would be using framework 1
If you just want to pull the data from a SQL Server db and put it into a MS Access db then you can do that with MS Access very easy. Just create an ODBC connection to the SQL Server and set the default database to the one you will be importing. In access create a new data base and choose to import tables, browse to the ODBC DSN you created and select the tables you need. This will create all the tables in Access and populate them with the data in the existing DB.
Always use [code][/code] tags when posting code.
-
February 15th, 2012, 12:19 AM
#3
Re: Export data from Microsoft VB.Net to Excel or Access
Hello,
How about the following code:
Code:
Dim connString As String = "DataSource =.\SQLEXPRESSS;AttachDbFilename=|DataDirectory|\**.MDF;Integrated Security = True"
Dim orderSql As String = "SELECT **, **, ** FROM"
Dim Table As New DataTable()
Using conn As New SqlConnection(connString); { conn.Open(); SqlDataAdapter sda = New SqlConnection(connString)
End Using
sda.Fill(Table)
}
The above code is from http://www.c-sharpcorner.com/UploadF...-mark-designe/
-
February 15th, 2012, 12:59 AM
#4
Re: Export data from Microsoft VB.Net to Excel or Access
You do know that you can not mixed VB and C# syntax? That code would never work as is not to mention it does not address the issue which btw is 6 months old and likely solved or fogotten by now.
Always use [code][/code] tags when posting code.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|