PDA

View Full Version : Update excel record to existing DBtable



waka
11-19-2009, 01:26 AM
Hi, can any one help ?

i would like update my excel record into my database.i'm using this code but is not working. any advice make it work ?:banghead:


sqlStatement = "Update TestDB set 2009-11-Wk1 = Select E:E From [insert$]"

Bob Phillips
11-19-2009, 01:39 AM
Is this trying to insert multiple records at once, or one multi-column record?

What does the table definition look like?

waka
11-19-2009, 04:33 AM
trying to update multiple records at once into my existing database. my existing database, there is data in it. i just wanted to update multiple record at once. i cant use insert statement because it will look like fig 1, only use update statement. the actual result will look like figure 3

waka
11-19-2009, 04:37 AM
figure 3

waka
11-19-2009, 08:14 PM
Hi, i'm trying to update using this statement but its not working. :banghead:


"Update TestDB SET "
sqlStatement = sql & "2009-11-Wk1 = '" & Worksheets("Forecast").Range("E2:E6").Value"' "