Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing to Access db from asp

Status
Not open for further replies.

redsand

Programmer
Aug 15, 2001
45
US
I created an asp feedback form from frontpage. Under form properties I chose to send to database, under options chose to create database. It created a fpdb folder with the new database in it. I have given everyone full rights to the folder. However, when entering data into the form, it is not writing to the db? If I run it on my personal web server on my local machine it works great. Is there something on IIS that I need to set up. I have set up a user dsn and system dsn for the db. I am running iis5.0 with front page 2000. I have installed the front page extensions. The only thing that I have not done is install office 2002 on iis. As you can see I am new to both iis and asp.

Any help would be greatly appreciated!!!
 
even if you give full rights to anyone to insert into a database you still however need to have the directory the database resides in a writable directory. That is why it works localy but not server wise. Contact your host and have them make the directory you have created writable or ask for direction to the proper directory to store you DB's You cannot mandate productivity, you must provide the tools to let people become their best.
-Steve Jobs
admin@onpntwebdesigns.com
 
This is an intranet application. So on iis I have made everyone have full control(as a test) to the fpdb folder and all of its files including the database.
 
Hello Redsand,
I have some experience with connecting a database to asp in an Intranet and I think your problem might be a few things. Number 1, did you setup the system DSN on the IIS server itself? 2, Do you have the database located on that server or another computer?

I had problems connecting to a database located on another server. I have read a lot on it and i never did get it to work. Anyway I have ASP connecting to an Access 2000 database and it works great![pc3] CHAOS, PANIC, & DISORDER - my work here is done.
 
there is a way to set permissions for .MDB here's the manual stated steps. might work

Permissions for Access .MDB Files
To design/add/edit/delete Access databases with 1 Click DB must also grant Modify/Change permissions to the *.MDB Database File, the folder where the *.MDB file is located and the TMP and/or TEMP directory as specified in Control Panel -> System -> Advanced -> Environment Variables. In addition, none of these files or folders should be marked as Read Only .

You cannot mandate productivity, you must provide the tools to let people become their best.
-Steve Jobs
admin@onpntwebdesigns.com
 
I have created a user dsn as well as a system dsn on iis for the application. The fpdb folder resides on iis off of
 
Maybe you should post the code you use to connect to the database on the ASP?[idea] CHAOS, PANIC, & DISORDER - my work here is done.
 
Here is the beginning
' FP_ASP ASP Automatically generated by a Frontpage Component. Do not Edit.
On Error Resume Next

strErrorUrl = ""

If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
If Request.Form("VTI-GROUP") = "0" Then
Err.Clear

Set fp_conn = Server.CreateObject("ADODB.Connection")
FP_DumpError strErrorUrl, "Cannot create connection"

Set fp_rs = Server.CreateObject("ADODB.Recordset")
FP_DumpError strErrorUrl, "Cannot create record set"

fp_conn.Open Application("TaskForm_ConnectionString")
FP_DumpError strErrorUrl, "Cannot open database"

fp_rs.Open "Results", fp_conn, 1, 3, 2 ' adOpenKeySet, adLockOptimistic, adCmdTable
FP_DumpError strErrorUrl, "Cannot open record set"

fp_rs.AddNew
FP_DumpError strErrorUrl, "Cannot add new record set to the database"
Dim arFormFields0(8)
Dim arFormDBFields0(8)
Dim arFormValues0(8)



Here is the global.asa file

<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Application_OnStart
'==FrontPage Generated - startspan==
Dim FrontPage_UrlVars(2)
'--Project Data Connection
Application(&quot;new_page_1_ConnectionString&quot;) = &quot;DRIVER={Microsoft Access Driver (*.mdb)};DBQ=URL=fpdb/new_page_1.mdb&quot;
FrontPage_UrlVars(0) = &quot;new_page_1_ConnectionString&quot;
Application(&quot;new_page_1_ConnectionTimeout&quot;) = 15
Application(&quot;new_page_1_CommandTimeout&quot;) = 30
Application(&quot;new_page_1_CursorLocation&quot;) = 3
Application(&quot;new_page_1_RuntimeUserName&quot;) = &quot;&quot;
Application(&quot;new_page_1_RuntimePassword&quot;) = &quot;&quot;
'--Project Data Connection
Application(&quot;TaskForm_ConnectionString&quot;) = &quot;DRIVER={Microsoft Access Driver (*.mdb)};DBQ=URL=fpdb/TaskForm.mdb&quot;
FrontPage_UrlVars(1) = &quot;TaskForm_ConnectionString&quot;
Application(&quot;TaskForm_ConnectionTimeout&quot;) = 15
Application(&quot;TaskForm_CommandTimeout&quot;) = 30
Application(&quot;TaskForm_CursorLocation&quot;) = 3
Application(&quot;TaskForm_RuntimeUserName&quot;) = &quot;&quot;
Application(&quot;TaskForm_RuntimePassword&quot;) = &quot;&quot;
'--
Application(&quot;FrontPage_UrlVars&quot;) = FrontPage_UrlVars
'==FrontPage Generated - endspan==
 
you have this set to read-only
fp_rs.Open &quot;Results&quot;, fp_conn, 1, 3, 2 ' adOpenKeySet,
change to
fp_rs.Open &quot;Results&quot;, fp_conn, 3, 3, 2 ' adOpenKeySet, You cannot mandate productivity, you must provide the tools to let people become their best.
-Steve Jobs
admin@onpntwebdesigns.com
 
When I made the change I received the following message
Cannot update the database
Error Description: [Microsoft][ODBC Microsoft Access Driver] Cannot update. Database or object is read-only.

Error Number: -2147467259

Error Source: Microsoft OLE DB Provider for ODBC Drivers

I have given the everyone full rights to temp, fpdb dir
 
Well I'm at a loss. I found a identical frontpage generated script to yours and it worked localy also. Even knowing I diagree with the way frontpage sets it up.(not a uncommon thing to happen) Did you check the steps from the earlier post. I think the setting in IIS just need to be alocated for the permissions. Do the users get a error or is it just not writing to the DB. Is the script possibly timing out to soon. You cannot mandate productivity, you must provide the tools to let people become their best.
-Steve Jobs
admin@onpntwebdesigns.com
 
I was getting no errors on the page until I made that last change. I did all of the steps in the previous postings. Thanks for all of your help though. I really appreciate your help!!
 
Switch to MySQL, this got rid of all those stupid write errors

www.vzio.com
star.gif

star.gif
 
Hit the link checked permissions. Got rid of the error, but it is still not writing to db. Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top