sql statement for access database from vb.net

I keep getting an error when trying to get data from an access database when I use the order by clause - ierrorinfo.getdescription failed.  Any ideas?
Who is Participating?
Jorge PaulinoConnect With a Mentor IT Pro/DeveloperCommented:
A number doesn't need commas (if it's a number) and also use kaufmed suggestion about the brackets
sql = "select * from tools where job = 5687568 order by [position],[number]"
käµfm³d 👽Commented:
Perhaps if you posted your SQL and VB code, a solution could be more easily determined.
ddepuemdAuthor Commented:
sql = "select * from tools where job = '5687568' order by position,number"
            With dbAdaptr
                Dim cmd As OleDb.OleDbCommand = New OleDb.OleDbCommand(sql, cn)
                cmd.CommandType = CommandType.Text
                .SelectCommand = cmd
                .Fill(ds, "tools")
            End With
        Catch ex As Exception
            Dim str As String = ex.Message
        End Try
7 new features that'll make your work life better

It’s our mission to create a product that solves the huge challenges you face at work every day. In case you missed it, here are 7 delightful things we've added recently to monday to make it even more awesome.

käµfm³d 👽Commented:
Try putting "number" in brackets. "Number" is a reserved word (a data type name) in Access.

sql = "select * from tools where job = '5687568' order by position,[number]"
ddepuemdAuthor Commented:
yeah, I realized the key word problem and changed the table field names..
Jorge PaulinoIT Pro/DeveloperCommented:
any other problem ?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.