Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using VBA in Excel to connect to a SQL server and retreve data. That
is working. The problem is that I want to run an Update query to update one line in the database and it isn't working. Below is an example of the code I am using. Dim cmdCommand As New ADODB.Command Dim recSet As New ADODB.Recordset Dim cn As New ADODB.Connection cmdCommand.ActiveConnection = cn strSQLCommand = "UPDATE Materials.ReportName = test Where materials.MaterialID = 5" cmdCommand.CommandText = strSQLCommand cmdCommand.CommandType = adCmdText Set recSet = cmdCommand.Execute please help -- KC |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Running MS Query on an Excel Spreadsheet | Excel Discussion (Misc queries) | |||
Running multiple queries in Microsoft Query in Excel | Excel Programming | |||
How access/query/update Excel using VC? | Excel Programming | |||
Running an Access Query From Excel | Excel Programming | |||
Excel-Macro running through SQL update. | Excel Programming |