none
Need help i program get on this error message Syntax error in FROM clause. RRS feed

  • Question

  • Yesterday my program run smooth and all function can be run. But today when i run my program my program get a error message (Syntax error in FROM clause.)

    How i can solve this issue.

      app.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=MYX.accdb"

      Private Sub RefreshData()
            If Not app.State = ConnectionState.Open Then
                app.Open()
            End If
            Dim da As New OleDb.OleDbDataAdapter("SELECT ID, UserID as [ItemName], " & _
                                                 "Name as [Name]" & _
                                                 "FROM USER ORDER BY ID", app)
            Dim dt As New DataTable
            da.Fill(dt)
            Me.dgv.DataSource = dt
            app.Close()
        End Sub

    • Edited by christing Thursday, August 8, 2019 9:31 AM
    Thursday, August 8, 2019 9:18 AM

All replies

  • Hi,

    try to fix your code:

      Dim da As New OleDb.OleDbDataAdapter("SELECT ID, UserID as [ItemName], " & _
                                                 "Name as [Name]" & _
                                                 "FROM [USER] ORDER BY ID", app)

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, August 8, 2019 9:37 AM