Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JVS JVS is offline
external usenet poster
 
Posts: 5
Default Export information to Access.

Trying to automate an import process.
Could some one share the code to export all the data from a specific Excel
sheet to an existing Access database table?

Thanks!
jvs


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 153
Default Export information to Access.

Does not record as part of auto record macro. I put in
for help "access" and came up with this to begin with,
which indicates a need to open the access file in a
specific mode to write to it. I think you could do an
append from the clipboard, but I don't know access very
well. Maybe this will get you started in the right
direction.

Open Statement
Enables input/output (I/O) to a file.
Syntax
Open pathname For mode [Access access] [lock] As [#]
filenumber [Len=reclength]
The Open statement syntax has these parts:


-----Original Message-----
Trying to automate an import process.
Could some one share the code to export all the data

from a specific Excel
sheet to an existing Access database table?

Thanks!
jvs


.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Export information to Access.

This might be a help for getting data to and from Excel and Access: It
includes examples of using variables in SQL queries.
http://www.bygsoftware.com/examples/sql.html

Or you can get there from the "Excel with Access Databases" section on page:
http://www.bygsoftware.com/examples/examples.htm

It demonstrates how to use SQL in Excel's VBA to:

* create a database,
* create a table and add data to it,
* select data from a table,
* delete a table,
* delete a database.

DAO and ADO files available.

You can also download the demonstration file called "excelsql.zip".


--
Regards
Andy Wiggins
www.BygSoftware.com
Home of "Save and BackUp",
"The Excel Auditor" and "Byg Tools for VBA"



"JVS" wrote in message
...
Trying to automate an import process.
Could some one share the code to export all the data from a specific Excel
sheet to an existing Access database table?

Thanks!
jvs




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 459
Default Export information to Access.

Su

Sub tester()

Dim oConn As Object
Dim lngRowsAffected As Long
Set oConn = CreateObject("ADODB.Connection")

With oConn
.ConnectionString = "Provider=Microsoft.JET.OLEDB.4.0;" & _
"Data Source=C:\Tempo\New_Jet_DB.mdb"
.Open
.Execute "INSERT INTO MyTable" & _
" SELECT MyCol1 AS RefID, " & _
" MyCol2 AS Surname" & _
" FROM [Excel 8.0;Database=C:\Tempo\db.xls].[Sheet1$]", _
lngRowsAffected
.Close
End With

End Sub

--

"JVS" wrote in message ...
Trying to automate an import process.
Could some one share the code to export all the data from a specific Excel
sheet to an existing Access database table?

Thanks!
jvs

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access export [email protected] Excel Discussion (Misc queries) 0 February 9th 09 02:16 PM
Export all grouped information to different sheets stumac Excel Discussion (Misc queries) 2 April 5th 07 02:10 PM
export access to excel. change access & update excel at same time fastcar Excel Discussion (Misc queries) 0 June 24th 05 09:27 PM
How do I export information from FileMaker and still display zero. caram Excel Discussion (Misc queries) 0 April 26th 05 10:04 PM
Export PDF information into Microsoft Excel Brian Excel Programming 0 January 5th 04 09:03 PM


All times are GMT +1. The time now is 01:41 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"