building a db connection in an asp.net site

windows

Guest
I am trying to connect to a db doing this:
Application>Databases>OLE DB Connection, I enter the conn name, and I press Build which (according to a book I'm reading) should open a data link properties dialog box.
Instead, I press Build and nothing happens? Can u give any help please, cause I'm stuck.
Thank You! ;)Are you using a wizard to do this? If not please post your code.No, I don't have any code, I'm doing it in DreamweaverI am assuming you are using access (oledb), but if you are not I can also help you with sql server.

Put this at the top of your page

<%@ Import Namespace="System.Data.OLEDB" %>

That is the proper namespace for oledb


Here is one of my access connection strings

Dim DBConn as OleDbConnection
DBConn = New OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;" _
& "DATA SOURCE=" _
& Server.MapPath("/yourdb.mdb;"))

I am just setting dbconn as the connection, dbconn will now the the variable name of my connection. I am saying that it is an oledb connection and that this is microsoft jet oledb 4 (access). The I just say where the thing is and that is it. There are other things you can include (like if your database has a password / user id you will need to include that), but this is just the most basic way to connect to an access db.

If you are connecting to this db on many pages you can actually put the connection string inside of the web.config and just use a reference to the web.config on your pages.Ok u r right.
But the next problem is that although I've tested the connection and it is succesfuly made, (I can see it in Application > Databases), when I click the + sign on the tables, I get NONE.
And I am sure it is my one and only database I can possibly connect, plus I tried to do the same using ASP VBscript and I got all of my tables.
What is going wrong?
Please help again! :confused:+ sign on the tables?yes, I am using dreamweaver and I get the database but I don纾
 
Back
Top