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 8622429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:03:06+00:00 2026-06-12T07:03:06+00:00

My program is written in VB.NET and I have an excel sheet with only

  • 0

My program is written in VB.NET and I have an excel sheet with only one column and type of column is Text. Now I want to add all the rows of excel sheet into MS Access table.

My Access table has 5 columns, and I have to provide some static data for rest of fields. I can’t let them empty as my table structure won’t allow me to let them empty. they are mandatory.

My algorithm works this way

  • Read excel sheet data into a DataTable
  • Loop to the end of all rows of DataTable
  • Append text of each cell and some of my static information to make a query string

    INSERT into TableName(c1,c2,c3) 
    values 
    (v1,v2,v3),
    (v1,v2,v3),
    (v1,v2,v3),
    (v1,v2,v3)
    ...
    ...
    (n1,n2,n3);
    
  • Execute this query

But I got error in this query, Any suggestions?

  • 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-06-12T07:03:07+00:00Added an answer on June 12, 2026 at 7:03 am

    You can run SQL against a connection to interact directly with Access and Excel. For example, working with the connection:

    Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Z:\Test.xlsm;
    Extended Properties="Excel 12.0 xml;HDR=Yes;";
    

    Or Jet

    Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Z:\Test.xls;
    Extended Properties="Excel 8.0;HDR=Yes;";
    

    You can run the following SQL:

    INSERT INTO [;DATABASE=Z:\Docs\Test.accdb].Table1 (ID,Atext) 
    SELECT ID, AText FROM [Sheet7$] 
    

    Or Jet

    INSERT INTO [;DATABASE=Z:\Docs\Test.mdb].Table1 (ID,Atext) 
    SELECT ID, AText FROM [Sheet7$] 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a program written in VB.Net with Visual Studio 2008. I have one
I have written a VB.Net program however there is a bug in one of
I have the following in a program (written in VB.NET): Imports Microsoft.Office.Interop.Excel Public Class
I have a .NET program that I've written a Wix installer for. I want
I have a client program written in .NET 2.0, that connects to the web
I have a program written in VB.Net (Visual Studio 2008) that uses a DLL
I have a .exe program (console app) written in .net. I need to execute
I have a .net MDI application written in vb.net. I'm trying to program a
I have a .NET CF program (running on a Smartphone) and I have written
I have a program written in asp.net with lucene.net. At first I create an

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.