Jump to content

Recommended Posts

Posted

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

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...