Import excel spreadsheet to access97 database


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Import excel spreadsheet to access97 database

  1. #1
    Martin S Guest

    Import excel spreadsheet to access97 database


    Hi!!
    I wonder if it is possible to import data from an excel spreadsheet into
    a normalised access97 database with alot of tables in a way that the data
    in the spreadsheet will be inserted into the correct tables in the database?
    and if so, how? I have been trying to use an ASP-script with not much success.

    /Martin

  2. #2
    Paul Clement Guest

    Re: Import excel spreadsheet to access97 database

    On 1 Aug 2001 06:21:29 -0700, "Martin S" <martinsz@hotmail.com> wrote:


    Hi!!
    I wonder if it is possible to import data from an excel spreadsheet into
    a normalised access97 database with alot of tables in a way that the data
    in the spreadsheet will be inserted into the correct tables in the database?
    and if so, how? I have been trying to use an ASP-script with not much success.

    /Martin

    I don't know the structure of your Excel Workbook you can import using SQL and DAO or ADO.

    Sub ExportExcelToAccess()

    Dim cnn As New ADODB.Connection
    Dim sqlString As String

    cnn.Open _
    "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=D:\My Documents\db1.mdb;" & _
    "Jet OLEDB:Engine Type=4"

    sqlString = "SELECT * INTO [tblExcel] FROM [Excel 8.0;DATABASE=D:\My
    Documents\Test.xls].[Sheet1$A37]"

    cnn.Execute sqlString

    End Sub


    Paul ~~~ pclement@ameritech.net
    Microsoft MVP (Visual Basic)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center