PDA

View Full Version : Access Database (mdb) to Asp page?



divtag33
09-15-2006, 03:56 PM
Hi there,

I've been tasked with making a newsletter from an access database that is automatically compiled every month.

Now the data is very logical - ID - Article Title - Date - Article Content etc

So I figure if there was a way to dynamically include the data into an asp webpage, I'd save myself about a week's worth of work every month!

Can I ask - is it possible to directly access a mdb database from an asp webpage - it's on the company intranet, so the database file will need to be online.

I've read a few tutorials - but they always seem to start talking about OBDC options in control panel and saving the database locally - which unfortunately isn't an option.

If you could provide any input/suggestions/plans I'd be most appreciative - as I've already said, some input from a clever bod, could potentially save me hours and hours of mind-numbing work! ;)

Thanks very much

codeexploiter
09-19-2006, 05:41 AM
Yes you can do this job using ASP without much trouble as far as i think.



Originally posted by: divtag33

Can I ask - is it possible to directly access a mdb database from an asp webpage - it's on the company intranet, so the database file will need to be online.

Yes it is possible to access databases using ASP. If your web server can access your company intranet it can access the database and perform the retrieval operation.

To perform a database access you doesn't need a DSN all the time there is a DSN Less connection too using which you can perform the job or try to do it using OLE DB

You can find more details about OLE DB here http://www.drdev.net/article09.htm

You can refer web for getting some good idea about developing the system for example check the following out:

http://www.dmxzone.com/Downloads/Tutorial_23JuneMM_Newsletterb.zip/23June_MM_newsletter.pdf

divtag33
09-21-2006, 12:14 PM
brilliant - cheers!

Stom
10-04-2006, 12:33 AM
this could save you some screwing around... here's the code i use to connect my asp pages to access db's. change where appropriate. you'll need the adovbs.inc file (can be found in C:\Program Files\Common Files\System\ado on win xp) to be included. these locktype's will allow you to update the db as well,. change to suit the application.

more info on ado here: http://www.w3schools.com/ado/default.asp



<!-- #include file="adovbs.inc" -->
<%
Dim connect, rs, rs2, rs3

Set connect_db = server.CreateObject("ADODB.Connection") 'connect to main db
connect_db.Provider="Microsoft.Jet.OLEDB.4.0"
connect_db.Open Server.MapPath("---your db path---")
Set rs1 = Server.CreateObject("ADODB.Recordset")
rs.Open "Select * from rs1", connect, adOpenStatic, adLockOptimistic
Set rs2= Server.CreateObject("ADODB.Recordset")
news.Open "Select * from rs2", connect, adOpenStatic, adLockOptimistic
Set rs3= Server.CreateObject("ADODB.Recordset")
admin.Open "Select * from rs3", connect, adOpenStatic, adLockOptimistic
%>

GaryB007
10-16-2006, 10:42 PM
You could cheat a bit and use ASP Maker (http://www.hkvstore.com/aspmaker/).

It's saved me hours of coding when I need a quick and easy way of web enabling a database.

I'm not linked to them in any way. Just a satisfied customer.

codeexploiter
10-17-2006, 10:40 AM
Instead you can go for a good ASP IDE that is suitable for everything possible from ASP