Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how to link to DB to update data?


Hi;

I m new in VBA, can anyone tell me is it possible to use VBA to
update data to a database?

I m actually using a string like below to connect to my db:

Let DSN = Sheets("Settings").Range("B7").Value
strConn = "OLEDB;Provider=MSDASQL.1;Persist Security
Info=False;User ID=ABC;Password=password;Data Source='" & DSN & "'"

if i have a query:
StrSQL = "update table set field1='123' where id = 'abc'"

may i know how to code so that i could execute this StrSQL?

Thanks for your help :)
Doris


--
doristsr
------------------------------------------------------------------------
doristsr's Profile: http://www.excelforum.com/member.php...o&userid=35881
View this thread: http://www.excelforum.com/showthread...hreadid=558721

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
Excel 2007 data link update prompt Stampie Links and Linking in Excel 8 September 8th 09 11:41 AM
Don't update link Pedro Mestre Excel Discussion (Misc queries) 2 January 3rd 07 11:07 AM
update link Link Updates Excel Worksheet Functions 1 September 5th 06 05:55 PM
update a link to a CSV T Excel Discussion (Misc queries) 2 August 7th 05 09:00 PM
Macro To Update Data Table On DDE Link Change PMC[_2_] Excel Programming 1 July 13th 03 07:39 PM


All times are GMT +1. The time now is 12:22 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"