Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can anyone here tell me what is wrong with my SQL statement? I get a error of
Expected 1. Sub UpdateData2() On Error GoTo ErrorHandler Dim MyCn As ADODB.Connection Dim rst As ADODB.Recordset Dim strSQL As String Set MyCn = New ADODB.Connection ' Replace actual Access file path here MyCn.Open "DRIVER={Microsoft Access Driver (*.mdb)};" _ & "DBQ=G:\TestCQA.mdb" Set rst = New ADODB.Recordset strSQL = "SELECT * FROM tblExcel" _ & " WHERE tblExcel.TestID = " & Range("A2").Value rst.Open strSQL, MyCn If rst!IsReviewed = False Then 'no edit statement here? rst!IsReviewed = True rst.Update End If MyCn.Close ErrorHandler_Exit: Set MyCn = Nothing Exit Sub ErrorHandler: MsgBox Err.Description GoTo ErrorHandler_Exit End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
ADODB Connection | Excel Worksheet Functions | |||
ADODB Question | Excel Programming | |||
Problems with ADODB | Excel Programming | |||
ADODB | Excel Programming | |||
ADODB Recordset | Excel Programming |