Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > Visual Web Developer 2005
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Visual Web Developer 2005 Discuss creating ASP.NET 2.0 sites with Microsoft's Visual Web Developer 2005. If your question is more specific to a piece of code than the Visual tool, see the ASP.NEt 2.0 forums instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Web Developer 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 29th, 2007, 04:16 PM
Registered User
Join Date: Aug 2007
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Import text file to MS Access, Asp.net(VB)

I would appreciate any assistance with the above.
I am use to VBA in Access which is a 1 line code - docmd.tranfertext... to import information into an access database.

I am working with VB in ASP.net. I am new to this environment.
I already have a table tblcurrency. I want to update my table with text file C:\Textfile.txt
I will change the paths later - just want the code to work first

The error is:
Syntax error in INSERT INTO statement.

My code is:
 Dim cnn As OleDbConnection
        Dim strSQL As String
        Dim Debug As Diagnostics.Debug

        cnn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source = c:\Inetpub\wwwroot\TestDB\DB\Bonus.mdb")

        strSQL = "INSERT INTO [TblCurrency] (Country, Year) SELECT F1, F2 FROM[Text;HDR=NO;DATABASE=C:\;].[test.txt]"

       Dim objCommand As New System.Data.OleDb.OleDbCommand(strSQL, cnn)
        objCommand.CommandText = strSQL


  #2 (permalink)  
Old April 12th, 2008, 03:06 AM
Registered User
Join Date: Apr 2008
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

I think you still need to specify your database:


Hope this helps,

Jimi J

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
MS Access With VB.NET N4T3.T4NN3R ADO.NET 0 October 9th, 2008 01:47 PM
Import text file to MS Access, ASP.net rykie Access ASP 0 August 31st, 2007 03:07 AM
Administer MS Access MDW file in VB.NET iii_carlos BOOK: Beginning VB.NET Databases 1 April 30th, 2007 06:25 AM
Multiple delimiter Text file import into Access Suomi Access VBA 2 June 12th, 2005 10:26 AM

All times are GMT -4. The time now is 11:59 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.