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.
<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.