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

Hi,

When I come back to work today, I saw your replay. I am so happy that you
can help me.

Here's the code.

Sub t3()
'

'
Range("a2").Select

With ActiveSheet.QueryTables.Add(Connection:= _
"ODBC;DSN=MS Access
Database;DBQ=C:\db2.mdb;DefaultDir=C:;DriverId=25; FIL=MS
Access;MaxBufferSize=2048;PageTimeout=5;" _
, Destination:=Workbooks("test1.xls").Sheets("Sheet1 ").Range("B6"))
.CommandText = Array( _
"SELECT Sheet1.ID, Sheet1.`PR NUMBER`, Sheet1.DATE, Sheet1.`Number
1`, Sheet1.`Time Spend`" & Chr(13) & "" & Chr(10) & "FROM `C:\db2`.Sheet1
Sheet1" & Chr(13) & "" & Chr(10) & "WHERE (Sheet1.`PR NUMBER`=3.0)" _
)
.Name = "ExternalData_1"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = True
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.Refresh BackgroundQuery:=False
End With
End Sub


Regards,

Billy

----- Original Message -----
From: "onedaywhen"
Newsgroups: microsoft.public.excel.programming
Sent: Friday, November 28, 2003 12:48 AM
Subject: Write data to access file through EXCEL


Post your code that gets the data and me (or someone else) will
suggest how to modify it to write the data back to MS Access.

--

"Billy" wrote in message

...
Hi,

I have excel file, and I can get data from a excel file use VBA code.

But I
don't know how to write data back to that access file.
Could you help me?
Thanks

Billy








 
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
How do I write From Excel 2003 to Access 2000? [email protected] Excel Discussion (Misc queries) 0 November 30th 06 07:56 PM
Write data to access file through EXCEL Billy[_2_] Excel Programming 0 December 1st 03 05:14 AM
Write data to access file through EXCEL Billy[_2_] Excel Programming 0 December 1st 03 03:22 AM
Write data to access file through EXCEL Billy[_2_] Excel Programming 4 November 27th 03 04:48 PM
Can Excel write to an Access DB? Mike[_36_] Excel Programming 1 July 29th 03 05:18 PM


All times are GMT +1. The time now is 01:12 AM.

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"