Connecting to Database

They have: 1 posts

Joined: Apr 2004

I'm a new web designer and I am trying to figure out how and where I can get information that will explain how to connect to an Access Database that is hosted on a remote server.

I can create the Access Database. I can create the web site. I can't get them connected for the life of me. I am searching for where I can go or, a book I can buy that will lead me through this process one time. Everything I find is aimed at connecting to a SQL database and I am thoroughly confused. I have tried to use Web Matrix and Microsoft Visual Web Developer 2005 without any luck. Everything seems to be aimed at teaching you how to work with a database that is on your desktop computer and I can do that but, I need to be able to connect to one that is hosted somewhere else.

If I could maybe just find a book that walked you through the process using an Access Database it might help.

He has: 33 posts

Joined: Jun 2006

here's something to get you started with database connections with ASP. i wrote this in about a minute, so it may have an error or 2. you can find database related code at http://www.aspin.com/

DIM OCONN, FILEPATH, rsProducts

Const adOpenStatic = 3

SET OCONN = Server.CreateObject("ADODB.Connection")
SET rsProducts = Server.CreateObject("ADODB.RecordSet")

filePath = "db/products.mdb"
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(filePath)' & ";Jet OLEDB:Database Password="

rsProducts.open "SELECT * From products ORDER BY PRICE ASC",OCONN,adOpenStatic

rsProducts.movefirst

for i = 1 to 10
if rsProducts.eof then exit for

rsProducts.Fields("DESCRIPTION") 'Access field data
rsProducts.movenext
next

rsProducts.close
OCONN=nothing

He has: 113 posts

Joined: Jul 2005

Connecting to an access database on a remote server can prove difficult at the best of times. There are a number of security measures built into IIS that prevent things like flatfile database being used across servers in an attempt to stop hackers.

I'm not actually sure if its even possible to access an ms access database across servers without using an ODBC connection. a DNS-less connection def. won't do it - altough I can't say for sure as i've never tried. Just a gut feeling.

They have: 111 posts

Joined: Jun 2006

Hello.....Cool

U can refer to http://www.w3schools.com/ site, the ADO section.
I hope this would be of help to u for database connection.

---------------------------------------------------------------------------------------------
SBalan Group
http://www.sbalanprojects.com/

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.