CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2009
    Posts
    57

    ADO Connection string not working.

    I have the following connection string that can't open my database. Does anybody here know what's wrong with this string?


    Code:
    char strConnAccess[] = "Driver = {Microsoft Access Driver (*.mdb)};DBQ = C:\\DC2004.mdb;";//

    I know my program works because I can open it with

    Code:
    char strConnJet[] = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\\DC2004.mdb; User Id=admin; Password="; //Works

    I'm using the string examples from:

    http://www.sqlstrings.com/MS-Access-...on-strings.htm

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: ADO Connection string not working.

    Just as a guess: try to remove all unneeded white spaces from your connection string.
    Victor Nijegorodov

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured