Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Use Excel to update Access tables

Hi Angus
I use an sql string something like this by sending the record number from
column A
HTH
Charles

Sub Deactivate(RcdID As Integer)
'
strSQL = "Select Active"
strSQL = strSQL & " From " & GetFromIniFile("QueriesTables", "Data",
strIniFile)
strSQL = strSQL & " Where id=" & RcdID & ";"

cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " &
GetFromIniFile("dBPath", "dBBudget", strIniFile) & GetFromIniFile("dBNames",
"dBReviseBudget", strIniFile)
rst.Open strSQL, cnn, adOpenStatic, adLockOptimistic

On Error Resume Next
rst.Fields(0).Value = False
rst.Update
cnn.Close
Set rst = Nothing
Set cnn = Nothing
On Error GoTo 0


"Angus" wrote:

I got a query which extract data from Access table. Column A is a
auto-created key from Access table:

Column A Column B
123
124
125
126

How do I update data in column B and update the data in column B to Access
table, according to key in column A?

Thanks all.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default Use Excel to update Access tables

hmmm...

I am not quite understand. Would you elaborate more...?

Should I add:

dim strSQL as string
....etc?

"vqthomf" wrote:

Hi Angus
I use an sql string something like this by sending the record number from
column A
HTH
Charles

Sub Deactivate(RcdID As Integer)
'
strSQL = "Select Active"
strSQL = strSQL & " From " & GetFromIniFile("QueriesTables", "Data",
strIniFile)
strSQL = strSQL & " Where id=" & RcdID & ";"

cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " &
GetFromIniFile("dBPath", "dBBudget", strIniFile) & GetFromIniFile("dBNames",
"dBReviseBudget", strIniFile)
rst.Open strSQL, cnn, adOpenStatic, adLockOptimistic

On Error Resume Next
rst.Fields(0).Value = False
rst.Update
cnn.Close
Set rst = Nothing
Set cnn = Nothing
On Error GoTo 0


"Angus" wrote:

I got a query which extract data from Access table. Column A is a
auto-created key from Access table:

Column A Column B
123
124
125
126

How do I update data in column B and update the data in column B to Access
table, according to key in column A?

Thanks all.

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
How do I access the access data via Excel 2002 with auto update ? karthik Excel Programming 1 February 9th 07 01:56 PM
How to update ms access tables directly from ms excel? Nabin New Users to Excel 3 October 11th 06 01:48 PM
export access to excel. change access & update excel at same time fastcar Excel Discussion (Misc queries) 0 June 24th 05 09:27 PM
Using qry from excel to update tables in a db2 database onedaywhen Excel Programming 0 February 12th 04 12:03 PM
Using qry from excel to update tables in a db2 database DB2 Excel Programming 0 February 12th 04 09:01 AM


All times are GMT +1. The time now is 11:33 PM.

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"