[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.0

Import | Delimited text file into Access   Database

Asked by fordraiders in Microsoft Visual Basic.Net

Tags: file, text, import, access, delimited

vb.net 2003
Office 2003

What I have:
C:\TestData\Input.txt  
Text File Pipe Delimited    :  4 columns Of data
example:
00001|NO BRAND NAME ASSIGNED|6DU27|M3-.5 X 6 FLAT HD SOCKET CAP SCREW, CL10.9, ALLOY STEEL
00002|NO BRAND NAME ASSIGNED|6DU28|M3-.5 X 8 FLAT HD SOCKET CAP SCREW, CL10.9, ALLOY STEEL
00003|NO BRAND NAME ASSIGNED|6DU29|M3-.5 X 10 FLAT HD SOCKET CAP SCREW, CL10.9, ALLOY STEEL
00004|NO BRAND NAME ASSIGNED|6DU30|M3-.5 X 12 FLAT HD SOCKET CAP SCREW, CL10.9, ALLOY STEEL
00005|NO BRAND NAME ASSIGNED|6DU31|M3-.5 X 14 FLAT HD SOCKET CAP SCREW, CL10.9, ALLOY STEEL
00006|NO BRAND NAME ASSIGNED|6DU32|M3-.5 X 16 FLAT HD SOCKET CAP SCREW, CL10.9, ALLOY STEEL
00007|NO BRAND NAME ASSIGNED|6DU33|M3-.5 X 18 FLAT HD SOCKET CAP SCREW, CL10.9, ALLOY STEEL
00008|NO BRAND NAME ASSIGNED|6DU34|M3-.5 X 20 FLAT HD SOCKET CAP SCREW, CL10.9, ALLOY STEEL
00009|NO BRAND NAME ASSIGNED|6FB98|M3-.5 X 20 SOCKET SET SCREW, CUP PT., DIN 916, BLACK
00010|NO BRAND NAME ASSIGNED|1CB70|5/8 X 2" STANDARD SOCKET SHOULDER SCREW, 1/2-13 THRD, ALLOY

Access Database:
C:\TestData\InputData.mdb
1 Table
ImpData:   3 Fields
All text:
ImportID -Text   15  
Mfgname - Text 100
Gnum- Text 25
Desc- Text- 255

What I need:
I need a procedure that will import the "Input.txt"  into the Access Table

'' current code

Function ImportTextToAccess() As Boolean

        Dim AccessConn As New System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\dm2007\ImpData.mdb")
        AccessConn.Open()
        'New table
' This works  but the the delimiter  is not working correctly  !
        Dim AccessCommand As New System.Data.OleDb.OleDbCommand("SELECT * INTO [InpTable2] FROM [Text;DATABASE=C:\DM2007;HDR=no;FMT=Delimited(|)].[INPUT.txt]", AccessConn)




' This does not work at All.... ?
 'Existing table
        '   Dim AccessCommand As New System.Data.OleDb.OleDbCommand("SELECT * INTO [InpTable] FROM [Text;Database=c:\dm2007;Hdr=No;Fmt=Delimited(|)].[].[Input.txt]", AccessConn)

        AccessCommand.ExecuteNonQuery()
        AccessConn.Close()

    End Function

Thanks
fordraiders





[+][-]12/21/06 04:29 PM, ID: 18184500Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Microsoft Visual Basic.Net
Tags: file, text, import, access, delimited
Sign Up Now!
Solution Provided By: Sancler
Participating Experts: 1
Solution Grade: B
 
[+][-]12/21/06 07:01 PM, ID: 18185121Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091021-EE-VQP-81