NewsBot
1
Hello all.
I am having a bit of trouble connecting to my access database.
*** Public Sub ReturnUsers(ByVal connectionString As String)
******* Dim queryString As String = "SELECT * FROM users;"
******* Using connection As New Data.SqlClient.SqlConnection(connectionString)
*********** Dim command As New Data.SqlClient.SqlCommand(queryString, connection)
*********** connection.Open()
*********** Dim reader As Data.SqlClient.SqlDataReader = command.ExecuteReader()
*********** Try
*************** While reader.Read()
******************* Console.WriteLine(String.Format("{0}, {1}", _
*********************** reader(0), reader(1)))
*************** End While
*********** Finally
*************** ' Always call Close when done reading.
*************** reader.Close()
*********** End Try
******* End Using
*** End Sub
That's how I'm returning the users in the database. My connection string is : "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("users.mdb")
The error I'm getting is Keyword not supported: 'provider'.
I'm having trouble understanding why it's giving me this error when I got the connectionstring from connectionstrings.com
Any insight would help.
Much thanks and happy holidays.
More...
View All Our Microsft Related Feeds
I am having a bit of trouble connecting to my access database.
*** Public Sub ReturnUsers(ByVal connectionString As String)
******* Dim queryString As String = "SELECT * FROM users;"
******* Using connection As New Data.SqlClient.SqlConnection(connectionString)
*********** Dim command As New Data.SqlClient.SqlCommand(queryString, connection)
*********** connection.Open()
*********** Dim reader As Data.SqlClient.SqlDataReader = command.ExecuteReader()
*********** Try
*************** While reader.Read()
******************* Console.WriteLine(String.Format("{0}, {1}", _
*********************** reader(0), reader(1)))
*************** End While
*********** Finally
*************** ' Always call Close when done reading.
*************** reader.Close()
*********** End Try
******* End Using
*** End Sub
That's how I'm returning the users in the database. My connection string is : "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("users.mdb")
The error I'm getting is Keyword not supported: 'provider'.
I'm having trouble understanding why it's giving me this error when I got the connectionstring from connectionstrings.com
Any insight would help.
Much thanks and happy holidays.
More...
View All Our Microsft Related Feeds