| Author |
Topic |
|
Vassily Zaitsev
Starting Member
13 Posts |
Posted - 2012-04-27 : 15:39:52
|
| Hello GuysI'm new to the forum and i have a doubt.I have a table created in Excel 2007 and want to update the table through this data in SQL Server 2005 table.I already have the connection created so missing commands INSERT, UPDATE, and DELETEI click the button and make the action workI have a sample table: http://www.sendspace.com/file/mlgbdsWho can help me I thank you very mucha few weeks ago to this information.Regards to all. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
Vassily Zaitsev
Starting Member
13 Posts |
Posted - 2012-04-27 : 16:00:14
|
| Thanks buddy for the quick response, I look at the link and study hardyou have any examples created with this my need? |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-04-27 : 16:00:46
|
| the link has working code itself.------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
Vassily Zaitsev
Starting Member
13 Posts |
Posted - 2012-04-27 : 16:01:49
|
| thank you friend |
 |
|
|
Vassily Zaitsev
Starting Member
13 Posts |
Posted - 2012-05-04 : 15:40:52
|
| even with the link sent I did not managed to solve my problemI want to update the worksheet data in a column "A"two columns areexample:[A] [B]1 MariaAline 23 AlexI want to update the numbers in column "A"[A] [B]55 Maria56 Aline57 Alexthis is what I do, just update the data in column "A".Who can help me thank you. |
 |
|
|
Vassily Zaitsev
Starting Member
13 Posts |
Posted - 2012-05-04 : 15:43:30
|
| in my spreadsheet I have 3 buttons[INSERT][UPDATE][DELETE]Just missing the button UPDATEI click on UPDATE to update the column and the codes |
 |
|
|
RL
Starting Member
15 Posts |
Posted - 2012-05-04 : 16:51:12
|
| Looks like the UPDATE applies the current value to all rows in the Clientes table. Since the final value is 12, all rows end up with that value.Your SQL needs a WHERE clause to identify which row to update for each value. Something like this (VBA code may not be 100% correct):cn.Execute "UPDATE Clientes Set Clientes.Codigo =('" & Worksheets("Plan1").Cells(i, 1).Value & "') WHERE Clientes.Nome = ('" & Worksheets("Plan1").Cells(i, 2).Value & "')" |
 |
|
|
Vassily Zaitsev
Starting Member
13 Posts |
Posted - 2012-05-04 : 17:12:12
|
| You're the man, you helped me moretava breaking head two weeksI am more than eight hours working with VBA and was not able to solve this problema big hug my friend.Thank you. |
 |
|
|
RL
Starting Member
15 Posts |
Posted - 2012-05-04 : 17:21:11
|
| You're welcome, glad I could help! -- RL |
 |
|
|
|