|
-
Dec 11th, 2003, 10:51 AM
#1
Thread Starter
Member
From Database to Table
I´m trying to read from a database and put the info (name and percent) into a table, where I want the one with highest percent to be at the top.
But I´m not sure on how to read from the database
Can anyone show an example?
I got a database named skitgubbe.mdb
Thanks for answers
-
Dec 11th, 2003, 11:51 AM
#2
Frenzied Member
What language are you doing this in?
Being educated does not make you intelligent.
Need a weekend getaway??? Come Visit
-
Dec 11th, 2003, 04:29 PM
#3
Thread Starter
Member
I want a webapplication. So I was thinking on combine asp with VB.
Thanks
-
Dec 11th, 2003, 05:57 PM
#4
Frenzied Member
VB Code:
Dim Conn As OleDbConnection
Dim Cmd As OleDbCommand
Dim reader As OleDbDataReader
Conn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\somePath\mydb.mdb;User Id=;Password=;")
Cmd = New OleDbCommand("SELECT fieldName FROM tableName", Conn)
Try
Conn.Open()
reader = Cmd.ExecuteReader()
While (reader.Read())
Response.Write(Convert.ToString(reader("fieldName")) & "<br>")
End While
reader.Close()
Conn.Close()
Catch ex As Exception
Response.Write("Error Occurred: " & ex.Message)
End Try
Being educated does not make you intelligent.
Need a weekend getaway??? Come Visit
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|