Solved

Access Database manipulation without system DSN?

Posted on 2003-10-22
5
263 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Read about why website design really matters in today's demanding market.
Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This video teaches users how to migrate an existing Wordpress website to a new domain.

810 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