LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default insert excel to access

search this newsgroup - I posted some code for a similar query withing the
past month I'm sure
in the IDE ( the development environment) set a reference (Tools.referemces)
to Microsoft Active Data Objects 2.6 Library

Sub WriteDataToAccess()
Dim MyFile As String
Dim con As New ADODB.Connection
Dim SQL As String
Dim com As ADODB.Command

MyFile = "E:\Excel\Excel_Demos\Risk.mdb"
SQL = "insert into BondTable ( [Currency] ,[Security] ) values
('USD','Trsry 4 2018')"

con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & MyFile

With New Command
.ActiveConnection = con
.CommandType = adCmdText
.CommandText = SQL
.Execute
Debug.Print .Properties.Count
End With
con.close
Set con = Nothing
End Sub

you need to chaneg the obvious - database name etc, and amend the SQL
statement of course

"prabhu s" wrote:

Hi..
This is prabu. i have a question. i want to insert excel record
into access(not import or export).

i have text box in excel sheet Name, age, address & i have one button.
once i hit the button. all record insert to access.
can you help me for this.

 
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
Insert data in access by excel. Heera Chavan Excel Programming 0 April 28th 09 08:29 PM
Insert a subdatasheet in Excel, like Access SP Excel Discussion (Misc queries) 1 June 17th 08 04:29 PM
Insert Whole Row in Excel when one column is updated from Access. Gordy w/Hi Expectations Excel Programming 0 October 20th 05 02:26 AM
Is it possible to insert an Access Table object into Excel? Jake Marx[_3_] Excel Programming 6 May 5th 04 04:34 PM
Is it possible to insert an Access Table object into Excel? GJones Excel Programming 0 May 4th 04 02:35 PM


All times are GMT +1. The time now is 09:25 AM.

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

About Us

"It's about Microsoft Excel"