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

    "Data source name not found and no default driver specified!!!"

    On my form i have a datagrid control with an Adodc control, the adodc control is connected to a database using the app.path function(in run-time, under the "form_load" sub)... the datagrid is connected to the adodc control from the record source property...

    but... whenever i try running the program an error comes up... saying

    "Data source name not found and no default driver specified"

    This is what my coding looks like:

    Private Sub Form_Load()
    connection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Database.mdb;Persist Security Info=False"
    Adodc1.ConnectionString = connection
    End sub

    Could someone please help me!!!!!?????

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

    Re: "Data source name not found and no default driver specified!!!"

    And what does App.Path contain?
    Last edited by VictorN; November 20th, 2009 at 09:33 AM.
    Victor Nijegorodov

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

    Re: "Data source name not found and no default driver specified!!!"

    And one of the possible reasons is here: http://livedocs.adobe.com/dreamweave...e=31_trou5.htm
    Victor Nijegorodov

  4. #4
    Join Date
    Nov 2009
    Posts
    3

    Re: "Data source name not found and no default driver specified!!!"

    i used app.path to find the database's location instead of typing the entire file path!

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

    Re: "Data source name not found and no default driver specified!!!"

    Quote Originally Posted by abcdefg987 View Post
    i used app.path to find the database's location instead of typing the entire file path!
    Well, it is clear enough!
    But I asked you NOT "what for" are you using it. I asked you:
    Quote Originally Posted by VictorN View Post
    ... what does App.Path contain?
    In other words: what exactly was the connection string you were assigning to Adodc1.ConnectionString ?
    Victor Nijegorodov

  6. #6
    Join Date
    Nov 2009
    Posts
    3

    Re: "Data source name not found and no default driver specified!!!"

    ohh!! ooops!!
    i'm not to sure if i understood ur question but... i think
    app.path contains....... C:\Users\Arjun Puri\Desktop\Database.mdb

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

    Re: "Data source name not found and no default driver specified!!!"

    Quote Originally Posted by abcdefg987 View Post
    ... i think
    app.path contains....... C:\Users\Arjun Puri\Desktop\Database.mdb
    You "think" or it does contain this path?
    Did you check whether this DB was locked?
    Victor Nijegorodov

  8. #8
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: "Data source name not found and no default driver specified!!!"

    Why would you put the app (and db?) on THE DESKTOP? Probably can't WRITE to that folder

    If you're using Vista+, install everything to AppData instead
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

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