none
Error with VB code RRS feed

  • Question

  • I have the following code in my aspx page that deletes the contents from a table in MS Access. However it gives me the error "Syntax error in FROM clause.". Not sure the issue with this code. I tried "Delete * from Catalog" and "Delete from Catalog". Both give me the same error.

                Dim strConnString As String = "Provider=Microsoft.JET.OLEDB.4.0; Data Source=C:\TC\Catalog.mdb"
                Dim sSql As String = "Delete * from Catalog"
                Dim connAccess As New OleDbConnection(strConnString)
                Dim cmdAccess As New OleDbCommand(sSql, connAccess)
    
                cmdAccess.CommandType = CommandType.Text
    
                If connAccess.State = ConnectionState.Closed Then
                    connAccess.Open()
                End If
    
                cmdAccess.ExecuteScalar()
    



    Friday, February 7, 2020 6:32 PM

Answers

All replies