Question : error Query is too complex when updating record

Hi Experts,
It must be early in the morning and I am missing something probably simple.

My code:
Dim conn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & "'" & TextBox1.Text & "'" & ";Persist Security Info=False"
        Dim cmd1 As String = "Select * from Report"
        Dim adapter1 As New OleDbDataAdapter(cmd1, conn)
        Dim topics1 As New DataSet()
        adapter1.Fill(topics1, "Report")
        Dim builder1 As OleDb.OleDbCommandBuilder = New OleDb.OleDbCommandBuilder(adapter1)
        builder1.QuotePrefix = "["
        builder1.QuoteSuffix = "]"

For Each row In topics1.Tables("report").Rows

                If aa1 = 102 Then  ' variable value from elsewhere
                    row("Question102") = drCurrent("comment")   ' drCurrent("comment") value from other table
                Else
                    If aa1 < 98 Then
                        row("Question" & aa1) = drCurrent("result")    ' result from other table

                    End If
                End If

                builder1.GetUpdateCommand()
                adapter1.Update(topics1, "report")

Last line returns the error - Query is too Complex

All I basically want to do is to update an existing record in Access with VB 2005

regards

Answer : error Query is too complex when updating record

I found the problem!
I had more than 100 columns in the table.
When I tested with less than 100 it works fine.
Now I can do a workaround
Random Solutions  
 
programming4us programming4us