Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Importing Data From MS Access Table to SQL Server Table

Importing Data From MS Access Table to SQL Server Table

Scheduled Pinned Locked Moved Visual Basic
databasecsharpsql-serversysadmin
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    salman_syed_01
    wrote on last edited by
    #1

    I am developing an application using VB.Net. On backend I am using MS Access and SQL Server 2005 both. I want to Import data from MS Access table to SQL Server 2005 table using VB.Net. For example, I have a table on MS Access Database name "tblInternship". And I have a table with the same name on SQL Server 2005 Database. Now I want to Import data from Access.tblInternship to SqlServer.tblInternship using Vb.Net. How I can do this. Please send me a code or make me understand to solve this problem.

    J 1 Reply Last reply
    0
    • S salman_syed_01

      I am developing an application using VB.Net. On backend I am using MS Access and SQL Server 2005 both. I want to Import data from MS Access table to SQL Server 2005 table using VB.Net. For example, I have a table on MS Access Database name "tblInternship". And I have a table with the same name on SQL Server 2005 Database. Now I want to Import data from Access.tblInternship to SqlServer.tblInternship using Vb.Net. How I can do this. Please send me a code or make me understand to solve this problem.

      J Offline
      J Offline
      John_Adams
      wrote on last edited by
      #2

      Hi, This can be done in the following manner in SQL query analyzer. --------------------------------------------------------------------- BEGIN CODE -- option 1 INSERT INTO sqltable (field1, field2, field3) SELECT FIELD2, FIELD2, FIELD3 FROM OPENDATASOURCE( 'Microsoft.Jet.OLEDB.4.0', 'Data Source="c:\accessfile.mdb"; User ID=Admin;Password=',tablename) -- option 2 INSERT INTO sqltable (field1, field2, field3) SELECT FIELD2, FIELD2, FIELD3 FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','c:\accessfile.mdb';'admin';'', tablename) END CODE --------------------------------------------------------------------- You may try the same thing using VB.Net. I hope this helps :).

      Regards, John Adams ComponentOne LLC

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups