Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
SQL question
Is there anyway Excel VBA can communicate with SQL database for updating
records? Would appreciate any help and directions. Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
SQL question
Sure you can.
Look here to get started: http://www.jsgrant.com/tutorials/ado/ RBS "wana be xl master" wrote in message ... Is there anyway Excel VBA can communicate with SQL database for updating records? Would appreciate any help and directions. Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
SQL question
Sub SqlUpdate()
Dim rst As New Recordset Dim SQLcmd As String SQLcmd = "Insert into myTable (Field1,Field2) values('Value1','Value2')" ''"Update myTable values('Value1','Value2') where PrimaryKey = 'ID'" rst.Open Source:=SQLcmd, ActiveConnection:="Provider=SQLOLEDB;Data Source=Your_Server_Name;Initial Catalog= Your_Database_Name;UserId=Your_Username;Password=Y our_Password;" End Sub "wana be xl master" wrote: Is there anyway Excel VBA can communicate with SQL database for updating records? Would appreciate any help and directions. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|