Stumped - how to connect to Access db?

Discussion in 'Databases' started by interesting, Feb 19, 2004.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I have copied an .mdb file into _database directory (which I made manually with FrontPage). If I double-click the .mdb in FrontPage, it opens in Access.

    Now I'm trying to connect to it with Visual Studio. I have used the Access ODBC tool in DiscountAsp's Control Panel to set up a DSN, but I cant' figure out how to use this DSN to create a Connection object. Any help greatly appreciated!

    In my Visual Studio Server Explorer I can only see my own workstation.
    Gwenda
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    Which version of VS are you referring to?

    You really should consider using DSNLess connection (oleDB). It is more stable and faster.

    quote:Originally posted by interesting

    I have copied an .mdb file into _database directory (which I made manually with FrontPage). If I double-click the .mdb in FrontPage, it opens in Access.

    Now I'm trying to connect to it with Visual Studio. I have used the Access ODBC tool in DiscountAsp's Control Panel to set up a DSN, but I cant' figure out how to use this DSN to create a Connection object. Any help greatly appreciated!

    In my Visual Studio Server Explorer I can only see my own workstation.
    Gwenda
    </blockquote id="quote"></font id="quote">
     
  3. I'm using VS.NET 2003. I would *love* to use a DSNless oleDB connection. But I don't know how to set it up.

    Why can't I see my database in the Server Explorer window? All I can see are databases on my local workstation.

    Gwenda
    quote:Originally posted by bruce

    Which version of VS are you referring to?

    You really should consider using DSNLess connection (oleDB). It is more stable and faster.

    quote:Originally posted by interesting

    I have copied an .mdb file into _database directory (which I made manually with FrontPage). If I double-click the .mdb in FrontPage, it opens in Access.

    Now I'm trying to connect to it with Visual Studio. I have used the Access ODBC tool in DiscountAsp's Control Panel to set up a DSN, but I cant' figure out how to use this DSN to create a Connection object. Any help greatly appreciated!

    In my Visual Studio Server Explorer I can only see my own workstation.
    Gwenda
    </blockquote id="quote"></font id="quote">
    </blockquote id="quote"></font id="quote">

    Gwenda
     
  4. Bruce

    Bruce DiscountASP.NET Staff

    Gwenda,

    My suggestion:

    Forget about the server explorer. it doesn't work well w/ MS Access (especially if access is located on a remote server). It'll work fine w/ MS SQL.

    Here's the sample code that uses oleDB to connect to an access db

    http://kb.discountasp.net/article.aspx?id=10023



    quote:Originally posted by interesting

    I'm using VS.NET 2003. I would *love* to use a DSNless oleDB connection. But I don't know how to set it up.

    Why can't I see my database in the Server Explorer window? All I can see are databases on my local workstation.

    Gwenda
    quote:Originally posted by bruce

    Which version of VS are you referring to?

    You really should consider using DSNLess connection (oleDB). It is more stable and faster.

    quote:Originally posted by interesting

    I have copied an .mdb file into _database directory (which I made manually with FrontPage). If I double-click the .mdb in FrontPage, it opens in Access.

    Now I'm trying to connect to it with Visual Studio. I have used the Access ODBC tool in DiscountAsp's Control Panel to set up a DSN, but I cant' figure out how to use this DSN to create a Connection object. Any help greatly appreciated!

    In my Visual Studio Server Explorer I can only see my own workstation.
    Gwenda
    </blockquote id="quote"></font id="quote">
    </blockquote id="quote"></font id="quote">

    Gwenda
    </blockquote id="quote"></font id="quote">
     
  5. Bruce

    Bruce DiscountASP.NET Staff

    Gwenda,

    My suggestion:

    Forget about the server explorer. it doesn't work well w/ MS Access (especially if access is located on a remote server). It'll work fine w/ MS SQL.

    Here's the sample code that uses oleDB to connect to an access db

    http://kb.discountasp.net/article.aspx?id=10023



    quote:Originally posted by interesting

    I'm using VS.NET 2003. I would *love* to use a DSNless oleDB connection. But I don't know how to set it up.

    Why can't I see my database in the Server Explorer window? All I can see are databases on my local workstation.

    Gwenda
    quote:Originally posted by bruce

    Which version of VS are you referring to?

    You really should consider using DSNLess connection (oleDB). It is more stable and faster.

    quote:Originally posted by interesting

    I have copied an .mdb file into _database directory (which I made manually with FrontPage). If I double-click the .mdb in FrontPage, it opens in Access.

    Now I'm trying to connect to it with Visual Studio. I have used the Access ODBC tool in DiscountAsp's Control Panel to set up a DSN, but I cant' figure out how to use this DSN to create a Connection object. Any help greatly appreciated!

    In my Visual Studio Server Explorer I can only see my own workstation.
    Gwenda
    </blockquote id="quote"></font id="quote">
    </blockquote id="quote"></font id="quote">

    Gwenda
    </blockquote id="quote"></font id="quote">
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page