View Full Version : Stumped - how to connect to Access db?
interesting
02-19-2004, 01:03 AM
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
bruce
02-19-2004, 03:22 AM
Which version of VS are you referring to?
You really should consider using DSNLess connection (oleDB). It is more stable and faster.
[b]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">
interesting
02-19-2004, 03:52 AM
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
[b]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.
[b]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
bruce
02-20-2004, 03:06 AM
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
[b]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
[b]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.
[b]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">
bruce
02-20-2004, 03:06 AM
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
[b]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
[b]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.
[b]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">
vBulletin® ©Jelsoft Enterprises Ltd.