I cannot import the data from the Access database in Visual Studio community

Kenrick77 1 Reputation point
2021-08-17T11:29:42.693+00:00

Hi Experts,
I connected the database to the Visual Studio. However, I just cannot import the data or columns into the form in Visual Studio, I attached a photo, please help me ,thanks.123856-capture.png

Microsoft 365 and Office Access Development
{count} votes

5 answers

Sort by: Most helpful
  1. Michael Taylor 60,161 Reputation points
    2021-08-17T14:21:25.253+00:00

    The picture doesn't really help us. The Server Explorer UI just allows you to visualize data without using something like SSMS. It has nothing to do with your projects. To connect to the DB in your app you need the connection string, your app must be x86 (or Any CPU with Prefer 32-bit code enabled) so that it will use the Access DB driver and then you can load the data.

    In your screenshot there isn't any DataGridView or anything to actually load the data so we'll need to see how you're loading the data, if you are at all. If you aren't yet loading data then of course there isn't anything to do yet.

    0 comments No comments

  2. Kenrick77 1 Reputation point
    2021-08-17T16:25:34.14+00:00

    I could connect just now and I cannot now again. I encounter one more error which is this' The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.' It keeps coming back to me no matter which solution I applied.

    0 comments No comments

  3. Michael Taylor 60,161 Reputation points
    2021-08-17T17:37:03.957+00:00

    This is a bitness issue then most likely. That driver is installed for x86 but not x64. It'll work in VS which is an x86 app but won't work in an x64 app. In your application settings what platform are you targeting? If you are targeting 'Any CPU' then you need to ensure that the Prefer 32-bit option is checked in your project's Build properties. You'll then be targeting x86 even on an x64 OS. Alternatively if you only support Access then change your app's platform to x86 so it always runs in this mode.

    124035-image.png

    0 comments No comments

  4. Kenrick77 1 Reputation point
    2021-08-18T07:07:30.14+00:00

    Hi, how come my Visual Studio doesn't have data binding?


  5. Kenrick77 1 Reputation point
    2021-08-18T14:30:14.96+00:00

    I solved already and I encountered one new error which is I cannot save data to the Access database,please see the attached photo.124333-capture3.png


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.