Syntax error in FROM clause

A

Abdel

I use an .aspx (user control) page as follow:

<script runat="server">
Public Sub BtnSave_Click(byval obj As Object, e As EventArgs)
ReadRecords()
End Sub

Private Sub ReadRecords()

Dim conn As New OleDbConnection _
("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath("/MySiteFldr/database/Mydb.mdb"))
Dim cmd as new OleDbCommand _
("SELECT Col1 FROM myTable", conn)
Dim reader As OleDbDataReader

Try
conn.Open
reader = cmd.ExecuteReader
while reader.Read
response.write(reader.GetString(0) & "<br>")
End While

Catch e as Exception
Response.Write("Exception happened : " & e.Message)
Response.End
Finally
if not reader is nothing then
reader.Close
end if
if not conn is nothing then
conn.Close
end if
End Try

End Sub
</script>

<asp:button id=BtnSave text=Save runat=server onClick="BtnSave_Click" />

But I got the error message "Syntax error in FROM clause"
but my qurey seems to be okay !!!!

Any help will be welcome.
Thanks!

Abdel.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top