Dim objConnection As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="path")
objConnection.Open()

rndnum = rnd(99999999)
sql1 = "SELECT OrderID FROM Orders WHERE Orders.OrderID = '" & rndnum & " ' "
Dim MyCommand As New OleDb.OleDbCommand(sql1, objConnection)
MyReader = MyCommand.ExecuteReader
MyReader.Read()

The above is the code . When i ran my app i got the foll error



Data type mismatch in criteria expression.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: Data type mismatch in criteria expression.

Source Error:


Line 108: sql1 = "SELECT OrderID FROM Orders WHERE Orders.OrderID = '" & rndnum & " ' "
Line 109: Dim MyCommand As New OleDb.OleDbCommand(sql1, objConnection)
Line 110: MyReader = MyCommand.ExecuteReader
Line 111: MyReader.Read()


Please throw some ideas guys.thnx