View Full Version : submitting mdb
pete2t
07-18-2006, 03:26 PM
Hi guys..I know im doing somthing stupid prob but if u could help that would be ace.
I have checked permissions etc and the db isnt read only. Im using IIS etc ...Any suggestions?
Error Type:
Microsoft JET Database Engine (0x80040E09)
Cannot update. Database or object is read-only.
/newcon/add.asp, line 87
Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
Page:
POST 473 bytes to /newcon/add.asp
POST Data:
Last_Name=&First_Name=&Address= etc etc
_________________________________________
<%
if Request("submit") = "submit" then
set conn = server.createobject("ADODB.Connection")
conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Inetpub\wwwroot\foldername\databasename. mdb;"
set profile = Server.CreateObject("ADODB.Recordset")
Conn.BeginTrans
Profile.Open "Consultants", conn,3,3
Profile.AddNew
Profile("First_Name") = Request("First_Name")etc etc
Brandoe85
07-18-2006, 07:20 PM
How about the folder the db is in? Does IUSR_machine-name have write permissions?
pete2t
07-19-2006, 09:49 AM
hi,
cheers for the reply. :thumbsup: I did chage some extras permissions and that seems to have cleared up that error (after i said i had checked them aswell!!) ..im getting a type missmatch now on one of my submitting fields to the database
Profile("fieldname") = Request("fieldname")
something wrong with my open bit i think at the start and not this line..but i will have a fiddle.
pete2t
07-19-2006, 02:30 PM
this page is getting to me now ha ha! any help on this error?
<%
if Request("submit") = "submit" then
Set Conn = server.CreateObject("ADODB.Connection")
conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Inetpub\wwwroot\foldername\batabasename.mdb;"
set profile = Server.CreateObject("ADODB.Recordset")
Conn.BeginTrans
Profile.Open "table in database", conn,3,3
Profile.AddNew
Profile("First_Name") = Request("First_Name")
error:
Error Type:
Provider (0x80020005)
Type mismatch.
/newcon/add.asp, line 107
line 107:
Profile("DOB") = Request("DOB")
Its the same field name as database etc..i think its still something to do with the "starting" asp??
Cheers Guys in advance!!
Brandoe85
07-19-2006, 05:12 PM
Response.Write Request("DOB") and see what it outputs. Make sure it's in the correct format for access dates. I never use ADO, I always just do the SQL and execute it. But with access dates you have to put the date between '#', again, not sure if you have to when you use addnew.
Good luck;
pete2t
07-20-2006, 11:22 AM
Hey,
Thanks for your reply again.
I have managed to get a step further. Basically i have set up the data types in the access database as date/time and Number for some of the fields and although they are not set as required when submitting them on the web interface it comes up with the missmatch error becuase it wants a value submitted in that field. How can this be resolved?
What does the # thing do where should it go? (sorry kind of new to the whole asp thing)
the web interface does submit but doesnt input the values into the DBase.
(apart for some reason where u put values in all fields it just doesnt move when u hit submit)
Never ending probs lol!
Brandoe85
07-21-2006, 04:12 PM
Well, as I said, I never use ADO Methods, I always do the sql statements. Now if you are willing to try that, I can surely help you out. As for the addnew problem, maybe you can specify the column names you are updating like with this example:
http://www.ecodebank.com/details/?catid=6&catsubid=53&nid=474
Note: notice how you can specify the columns.
As for the dates, with sql you have to enclose the date with # like "#7/21/2006#'.
Good luck :)
pete2t
07-24-2006, 10:40 AM
Hi,
Thanks for ur reply..much appreciated.
Looks like the weekend has cured me and i have managed to get something sorted this am.
Its a miracle what good weather and a beer can do. :)
Cheers
Pete
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.