Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3277804
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:24:36+00:00 2026-05-17T19:24:36+00:00

I have an import which I made with the wizard, at least far enough

  • 0

I have an import which I made with the wizard, at least far enough just to save the specification. It imports CSV files, with headers, quote text qualifiers, and comma delimited. I then use the import specification in some vba that fires from a button click event.

Here are some things I am wondering:

So if the fields in the data are out of order the import fails? if the data does not contain all the fields the import fails? if there are extra fields in the data the import fails?

So is there any kind of validation I can do to the data getting imported th ensure that the fields are the same as the spec, they are in the right order (if they need to be), etc.

This works pretty well, but I just see that if something in the data is out of the normal it will import anyway, and throw the whole time off.

Also….this is not a typical access set up…this is mainly for a team of data analysts to import files into a mdb…there is not an front end with this.

thanks
justin

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T19:24:37+00:00Added an answer on May 17, 2026 at 7:24 pm

    You can inspect the CSV file using an ADO recordset.

    Public Sub InspectCsvFile()
        Const cstrFolder As String = "C:\Access\webforums"
        Const cstrFile As String = "temp.csv"
        Dim i As Integer
        Dim strConnect As String
        Dim strSql As String
    
        'early binding requires reference, Microsoft ActiveX Data Object Library '
        'Dim cn As ADODB.Connection '
        'Dim rs As ADODB.Recordset '
        'Dim fld As ADODB.Field '
        'Set cn = New ADODB.Connection '
        'Set rs = New ADODB.Recordset '
    
        'late binding; no reference needed '
        Dim cn As Object
        Dim rs As Object
        Dim fld As Object
        Set cn = CreateObject("ADODB.Connection")
        Set rs = CreateObject("ADODB.Recordset")
    
        strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
            cstrFolder & ";Extended Properties=""text;HDR=Yes;FMT=Delimited"";"
        'Debug.Print strConnect '
        cn.Open strConnect
        strSql = "SELECT * FROM " & cstrFile & ";"
        rs.Open strSql, cn
        Debug.Print "Fields.Count: " & rs.Fields.Count
        For i = 0 To rs.Fields.Count - 1
            Set fld = rs.Fields(i)
            Debug.Print i + 1, fld.Name, fld.Type
        Next i
        Set fld = Nothing
        rs.Close
        Set rs = Nothing
        cn.Close
        Set cn = Nothing
    End Sub
    

    If that connection string doesn’t work for you, see Connection strings for Textfile

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made an object named Skill and the main program. Skill : import
I have an Excel file (which has data imported from Oracle 10G Database) one
I have made a program with a scroll pane, but it is not working.
I have made a program that has a Toolbar with a few actions on
I have a big (1.9 GB) XML file which has data I want to
I am working on a series of unit tests in Python, some of which
We are developing webapps with Eclipse + Tomcat plugin. We recently started a new
Until like one hour ago, I was convinced that in python Foo ().bar ()
Short question : I know how to draw text on a wx.Bitmap, but how
Autofocus is not working on the first AVCaptureSession when I create a second AVCaptureSession.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.