Solved

Access Database manipulation without system DSN?

Posted on 2003-10-22
5
264 Views
Last Modified: 2011-10-03
I am designing a website consisting of an access database, and some ASP pages to view and hopefully edit the database information.  The ISP which hosts the site won't allow me to create a system DSN, or set up anything as far as SQL goes, but I'm stuck with them because of a contract the previous web guy made.  To display the data I want, i've created a file DSN in the web root and used it to access the database (no pun intended) and display the info in a table.  That's fine and good, but I'm having trouble being able to modify the database.  I created a Data Access Page in access, but it won't work unless opened locally on the server.  What are my options for access database manipulation over the web without using either a system DSN or other server side database referencing deals?  
0
Comment
Question by:alanteigne
  • 3
5 Comments
 
LVL 4

Expert Comment

by:hamidovt
ID: 9605104
you can open Access file (aaa.mdb or whatever is the name of your db) using its physical path.
when you need to modify you database, just download it via ftp, make the changes and upload again.
I guess this will solve your problem.

to can open Access file using its physical path you ca use following connection

dim cn
set cn = server.CreateObject ("ADODB.Connection")
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=e:/mydir/mydb.mdb"

for more info refer to following url  http://www.w3schools.com/ado/ado_connect.asp
0
 
LVL 4

Accepted Solution

by:
Zonebit earned 250 total points
ID: 9606878
hamidovt gave a correct answer but I would tweak it just a little bit:

'''
dim cn
dim conStr
dim dbPath

'dbPath should be the virtual path to the database on your webserver
dbPath = Server.MapPath("/db/web/directory")
set cn = server.CreateObject ("ADODB.Connection")
conStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbPath & ";User Id=admin;Password="
cn.Open conStr
'''

As for having trouble updating your database, the "IUSR_" and "IWAM_" accounts must have write privileges to the database.  This solves 90% of insert/updating problems.
0
 

Author Comment

by:alanteigne
ID: 9607302
Thanks guys!  Actually, I gave in and went ahead and signed up for a new hosting provider since i'm under the gun.  However, I'll try to get your suggestion working for future projects.  Thanks again!
0
 
LVL 4

Expert Comment

by:hamidovt
ID: 9607362
well...
if you appreciate my answer why havent you split points????
0
 
LVL 4

Expert Comment

by:hamidovt
ID: 9607367
Zonebit just added some comments to it and you gave all points to him
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question