VB error 2147467259 if I remember right is something to do with database connectivity...
I'd recommend checking the connection string to your database (whether it be SQL or Access). Ensure that the database is located exactly where the connection string is pointing to.
Dim Adapter As New OleDbDataAdapter
Dim Command As New OleDbCommand
Dim xFrom As String = dtpFrom.Value.ToString.Substring(0, dtpFrom.Value.ToString.IndexOf(" "))
Dim xTo As String = dtpTo.Value.ToString.Substring(0, dtpTo.Value.ToString.IndexOf(" "))
sqlQuery = MainQuery ...