none
Problems connecting to Access Database: RRS feed

  • Question

  • Windows Vista
    Visual Studio 2008 Team Suite
    Microsoft Access 2007
    Error: Format of the initialization string does not conform to specification starting at index 0

    I've seen the discussion http://social.msdn.microsoft.com/Forums/en-CA/adodotnetdataproviders/thread/9f191038-dbf6-4306-8f66-ec211a1e933a and none of the suggestions help.

    When I
    1. Click "Add New Data Source" the "Data Source Configuration Wizard" appears.

    2. I choose "Database", then click "Next". Successful data connections are available from the dropdown in the following screen, but none of them are what I want. I click "New Connection" The "Add Connection" dialog box appears.

    3.  I click "Change" and select the entry "Microsoft Access Database file".  I click "OK".

    4. The "Add Connection" dialog box displays the appropriate choice at the top, but the list below contains only the category "Misc" with an entry Connection String. When I type the connection string into the box next to that I can click on "Test Connection" and that reports success. But if I click on OK I get the error message quoted above.

    I've tried both with JET and ACE connection strings (with *.mdb resp. *.accdb files), the same error message appears. I've checked and double-checked spelling, stray characters, etc. and don't find any errors. Sample:

    Provider=Microsoft.Jet.OLEDB.4.0;Data Source="D:\Books\WordDev3Final\CD-ROM\Datenbank\Nordwind.mdb";

    The connection string DOES work when I use it in a VBA procedure to link via ADO.

    I tried a repair of the Visual Studio installation, no joy.

    What else can I try?

    Edit: I tried the same on another installation and got a completely different dialog box in Step 4. above. There was no problem with the connection on that machine. But I need this on my main development machine, not someone else's.


    Cindy Meister, VSTO/Word MVP
    Monday, January 24, 2011 4:05 PM

All replies

  • Hi Cindy,

    Thanks for your post.

    In your step4 the "Add Connection" dialog box should like in this way:

    you can "Browse" your .accdb file, then "Test Connection"-----> success

    >>>>>The "Add Connection" dialog box displays the appropriate choice at the top, but the list below contains only thecategory "Misc" with an entry Connection String. When I type the connection string into the box next to that I can click on "Test Connection" and that reports success. But if I click on OK I get the error message quoted above.

    Connection string may like this way:("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\users.accdb"

    Have a nice day.

     


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, January 25, 2011 6:29 AM
    Moderator
  • Hello Alan

    Thank you for the reply.

    Yes, I know how it should look, but it does not. That's the problem! Tell me how I can insert a screen shot in my reply and I'll show you what I'm seeing...

    As best I can tell, VS is not recognizing the "data type" (OLEDB), so doesn't show the correct dialog box. As I said, I tried repairing VS. And OLEDB is correctly registered on Windows since I can connect using ADO. The problem is somewhere in Visual Studio and this "Wizard".


    Cindy Meister, VSTO/Word MVP
    Tuesday, January 25, 2011 8:15 AM
  • Hi Cindy,

    Thanks for your feedback.

    You can upload your screen shot to your free space on the internet(MSN space), then Copy the picture and paste here, it is easy.

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, January 25, 2011 8:32 AM
    Moderator
  • I don't have an "MSN space", but apparently what I do have works...


    Cindy Meister, VSTO/Word MVP
    Tuesday, January 25, 2011 8:44 AM
  • Hi Cindy,

    I could not see you picture, you can sent mail to me: v-alache@microsoft.com

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, January 25, 2011 8:51 AM
    Moderator
  • Hi Cindy,

    Some questions need to clarify with you.

    Have you cleaned up your registry or installed other third parties on your machine?

    It seems that your question is related with VS IDE. Well, please check the following steps and check if your question was resolved after each step.

    1. If you have installed some third parties on your machine, please uninstall them first and then try it again.

    2. Devenv.exe /SafeMode

    3. Devenv.exe /ResetSettings

    4. Switch other user account or create a new account and try it again.

    Best Regards,

    Larcolais

     


    Larcolais Gong[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, January 25, 2011 9:19 AM
  • Hi Larcolais

    <<Have you cleaned up your registry or installed other third parties on your machine?>>

    If you're asking, have I ever used a "Registry cleaner", the answer is NO. I'm not sure what you mean by third parties (third party software). Of course I have non-MS software installed (anti-virus, Adobe Reader, printer software, for example), but nothing that extends Visual Studio or the .NET Framework in any way.

    1. Please be more specific about what kind of third-party software you mean.

    2. Had no effect

    3. Had no effect

    4. Am testing... Edit: Had no effect


    Cindy Meister, VSTO/Word MVP
    Tuesday, January 25, 2011 10:00 AM
  • Hi Larcolais / Alan

    Thinking back to a thread I read elsewhere, with a suggestion about replacing Registry entries (which I have NOT done)...

    Here's the information for the key HKLM/Software/Microsoft/Visual Studio/9.0/Data Providers/HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\DataProviders\{7F041D59-D76A-44ed-9AA2-FBF6B0548B80}

    Default: .NET Framework Data Provider for OLE DB
    Description: DataProvider_OleDB_Description, SR, Microsoft.Data.ConnectionUI.Dialog, Version=9.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a
    DisplayName: DataProvider_OleDB, SR, Microsoft.Data.ConnectionUI.Dialog, Version=9.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a
    FactoryService: {8CB5F787-2D74-459e-88D6-39E20A4D9454}
    InvariantName: System.Data.OleDb
    ShortDisplayName: DataProvider_OleDB_Short, SR, Microsoft.Data.ConnectionUI.Dialog, Version=9.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a
    Technology: {77AB9A9D-78B9-4ba7-91AC-873F5338F1D2}


    Cindy Meister, VSTO/Word MVP
    Tuesday, January 25, 2011 10:10 AM
  • Hi Cindy,

    It's great to see three MSFT and a MVP in this thread!  The issue must be very interesting.  :)

    First, I think besides the provider .NET Framework Data Provider for OLE DB, what the Visual Studio IDE loads can also be the provider Microsoft.Jet.OLEDB.4.0.  I have no Visual Studio 2008 now, but I tested on Visual Studio 2010.  When the "Add Connection" dialog shows, I logged the Registry access of VS using Process Monitor, http://technet.microsoft.com/en-us/sysinternals/bb896645.  

    There are some Registry access records like:
    HKCR\Microsoft.Jet.OLEDB.4.0\CLSID
    HKCR\Wow6432Node\CLSID\{dee35070-506b-11cf-b1aa-00aa00b8de95}

    For the different behavior in your Visual Studio, I would recommend you use Process Monitor to check the Registry Access records in the two machines which have different behavior.  

    If you have any questions, please feel free to let us know.   You may directly ping Alan or me at misun@microsoft.com.   Actually, Alan and Larcolais both sits beside me.  :)

    Good day!

    Thanks


    Michael Sun [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, January 26, 2011 1:30 PM
    Moderator
  • Hi Cindy,

    Could you please tell us how is the problem now?  If you have any questions, please feel free to let me know.

    Have a nice weekend!

    Thanks


    Michael Sun [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Sunday, January 30, 2011 5:11 AM
    Moderator
  • Hi Lingzhi

    Unfortunately, things have gotten really busy, here, and I haven't had the time to delve into the information the proposed tool gives me. (I spent hours just trying to figure out how to get it to work in a reasonable way.) I got to the point where I had a "picture" of the Registry entries it recorded, but not to where I could compare the results of the two sytems.

    I'm not going to be able to get back to this before April...


    Cindy Meister, VSTO/Word MVP
    Friday, February 11, 2011 7:36 AM
  • Hi Cindy,

    It's really hard to troubleshoot such kind of issues.   If you have time to go back to this question, please feel free to re-open this thread or create a new one.  We will be very glad to help you. 

    Hope you have a nice weekend!

    Thanks


    Michael Sun [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, February 11, 2011 2:14 PM
    Moderator