To resolve your issue, please read this:
End of statement expected - Visual Basic | Microsoft Docs[
^]
If it's a hole code, then you need to know that
Try
instruction should ends with
End Try
. See:
Try...Catch...Finally statement - Visual Basic | Microsoft Docs[
^]
There's few other things to improve...
1. Your code is sql injection vulnerable. See:
SQL Injection - SQL Server | Microsoft Docs[
^]
You have to use parameters!
2. You shouldn't store password as a plain-string. Please, read this:
Password Storage: How to do it.[
^]
3. You have to use
Using Statement - Visual Basic | Microsoft Docs[
^] to manage disposable resources (objects).
So...
Dim ConnString As String = "..."
Dim dt As DataTable = New DataTable()
Dim sCommand As String = "SELECT * FROM Table1 WHERE SomeField=?;"
Using conn As New OleDbConnection(connString)
conn.Open()
Using cmd As New OleDbCommand(sCommand, conn)
cmd.Parameters.AddWithValue("?", SomeValue)
Using reader AS OleDbDataReader = cmd.ExecuteReader()
dt.Load(reader)
End Using
End Using
End Using