Code for discontinued OLEDB connection. RRS feed

  • Question


    I use

    cs As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\CADS\CADS.mdb"

    to connect to a *.mdb database. This works fine in XP and Vista. But with windows 7 the oledb connection has been discontinued. i have changed the Provider to "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccess2007file.mdb" this seems to work alright for the provider. BUT the rest of the code appears to be causing an error, namely


    cn As New
    Dim da As New OleDbDataAdapter(str, cs)


    Could you please advise the new code for the data adapter and the connection.


    • Edited by Allen_MSDN Wednesday, November 30, 2011 2:54 AM make it more easy to read
    Tuesday, November 29, 2011 5:21 AM

All replies

  • What is the error and on what line of code does it occur?
    Paul ~~~~ Microsoft MVP (Visual Basic)
    Tuesday, November 29, 2011 1:11 PM
  • Hi MurrayS,

    Please provide some error message to us, this is, so we can help you more effectivley.

    Best Regards

    Allen Li [MSFT]
    MSDN Community Support | Feedback to us
    Wednesday, November 30, 2011 2:56 AM
  • Hi MurrayS,

    Have you fixed your issue? I look forward to hearing from you. If you have any problems, please feel free to let me know.

    Best Regards

    Allen Li [MSFT]
    MSDN Community Support | Feedback to us
    Monday, December 5, 2011 1:51 AM
  • I am unable to make contact with client.

    I assume that the problem has been resolved.

    I will reopen if it surfaces again.

    Sunday, December 18, 2011 9:57 PM