472,325 Members | 2,158 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,325 software developers and data experts.

Send data to microsoft access

Please help!

I am an ICT teacher at a secondary school and my year 12 (AS Level)
group need to create a website where data can be sent from a form to a
Microsoft Access database.

I am trying to do this in my own time and then hopefully teach them
how to do it.

I have installed IIS on my machine and have followed a few web
tutorials on how to get data from an Access database on to your
webpage which i've found quite easy.

The difficulty comes when i want to SEND data to my database using a
form.

I have created a database called "test.mdb"
The database has one table called "customer"
The customer table has 4 fields "ID" "Surname" "Forname" "Age"
The datatypes of the fields are "number" "Text" "Text" "number"
I have set no primary key (I believe that this might make it easier to
solve)

I am trying to keep it REALLY simple to start with and only sending
one piece of data to start with, that being a "Surname"

I have created a "form.asp" page with the following code:

<html>
<body><form method="post" action="send_data.asp">
<table>
<tr>
<td>Surname:</td>
<td><input name="Surname"></td>
</tr>
</table>
<br /><br />
<input type="submit" value="Add New">
<input type="reset" value="Cancel">
</form></body>
</html>
I have then create a "send_data.asp" page that SHOULD recieve the data
and send it to the database, this is the code:

<html>
<body>

<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "C:/Inetpub/wwwroot/test.mdb"
sql="INSERT INTO customer (Surname)"
sql=sql & " VALUES "
sql=sql & "('" & Request.Form("Surname") & "')"
on error resume next
conn.Execute sql,recaffected
if err<>0 then
Response.Write("No update permissions!")
else
Response.Write("<h3>" & recaffected & " record added</h3>")
end if
conn.close
%>

</body>
</html>

HOWEVER, when i press the "Add New" button on the "form.asp" page it
takes me to the "send_data.asp" page but all it says is:

No update permissions!

As far as i know i have checked the permissions of my database file
and i have full privilages but it won't send the data.

So to summarise i can request data from my database and it works fine
but i can not send data to it (Have tried so many on line tutorials).

Would really appreciate some help (in as much detail as possible
please - where i might have gone wrong - how to resolve the problem)

Thank you in advance

Trig

Feb 12 '07 #1
5 5972
>>No update permissions!

Maybe it isn't a permissions error.

Remove the On Error and your error trapping, and you will see what the error
is.

Oh, and make sure you've unchecked the "Show Friendly Error Messages" if
using Internet Destroyer.

Bob Lehmann

"trig" <ma**********@hotmail.comwrote in message
news:11*********************@l53g2000cwa.googlegro ups.com...
Please help!

I am an ICT teacher at a secondary school and my year 12 (AS Level)
group need to create a website where data can be sent from a form to a
Microsoft Access database.

I am trying to do this in my own time and then hopefully teach them
how to do it.

I have installed IIS on my machine and have followed a few web
tutorials on how to get data from an Access database on to your
webpage which i've found quite easy.

The difficulty comes when i want to SEND data to my database using a
form.

I have created a database called "test.mdb"
The database has one table called "customer"
The customer table has 4 fields "ID" "Surname" "Forname" "Age"
The datatypes of the fields are "number" "Text" "Text" "number"
I have set no primary key (I believe that this might make it easier to
solve)

I am trying to keep it REALLY simple to start with and only sending
one piece of data to start with, that being a "Surname"

I have created a "form.asp" page with the following code:

<html>
<body><form method="post" action="send_data.asp">
<table>
<tr>
<td>Surname:</td>
<td><input name="Surname"></td>
</tr>
</table>
<br /><br />
<input type="submit" value="Add New">
<input type="reset" value="Cancel">
</form></body>
</html>
I have then create a "send_data.asp" page that SHOULD recieve the data
and send it to the database, this is the code:

<html>
<body>

<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "C:/Inetpub/wwwroot/test.mdb"
sql="INSERT INTO customer (Surname)"
sql=sql & " VALUES "
sql=sql & "('" & Request.Form("Surname") & "')"
on error resume next
conn.Execute sql,recaffected
if err<>0 then
Response.Write("No update permissions!")
else
Response.Write("<h3>" & recaffected & " record added</h3>")
end if
conn.close
%>

</body>
</html>

HOWEVER, when i press the "Add New" button on the "form.asp" page it
takes me to the "send_data.asp" page but all it says is:

No update permissions!

As far as i know i have checked the permissions of my database file
and i have full privilages but it won't send the data.

So to summarise i can request data from my database and it works fine
but i can not send data to it (Have tried so many on line tutorials).

Would really appreciate some help (in as much detail as possible
please - where i might have gone wrong - how to resolve the problem)

Thank you in advance

Trig

Feb 13 '07 #2
trig wrote:
>
No update permissions!
All users of the database file need to be able to create, modify and
delete a locking file that has a .ldb extension in the folder that
contains the database file. This means that users need Change/Modify
permissions for the folder, not just the .mdb file. Who the users are
depends on what type of authentication your website is using. If using
Anonymous, then the IUSR_machinename account requires permission for the
folder. Otherwise, all the accounts of the users themselves need the
permissions. See:
http://support.microsoft.com/default.aspx/kb/253604
http://support.microsoft.com/default.aspx/kb/166029
http://support.microsoft.com/kb/253580/EN-US/

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Feb 13 '07 #3
under internet options in internet explorer tools click security, then internet, then custom level, then under user authentication check automatic logon with current username & password AND VOILA!!!! There you have it....
---
Posted via DotNetSlackers.com
Apr 12 '07 #4
"trig" <ma**********@hotmail.comwrote in message
news:11*********************@l53g2000cwa.googlegro ups.com...
Please help!

I am an ICT teacher at a secondary school and my year 12 (AS Level)
group need to create a website where data can be sent from a form to a
Microsoft Access database.

I am trying to do this in my own time and then hopefully teach them
how to do it.

I have installed IIS on my machine and have followed a few web
tutorials on how to get data from an Access database on to your
webpage which i've found quite easy.

The difficulty comes when i want to SEND data to my database using a
form.

I have created a database called "test.mdb"
The database has one table called "customer"
The customer table has 4 fields "ID" "Surname" "Forname" "Age"
The datatypes of the fields are "number" "Text" "Text" "number"
I have set no primary key (I believe that this might make it easier to
solve)

I am trying to keep it REALLY simple to start with and only sending
one piece of data to start with, that being a "Surname"

I have created a "form.asp" page with the following code:

<html>
<body><form method="post" action="send_data.asp">
<table>
<tr>
<td>Surname:</td>
<td><input name="Surname"></td>
</tr>
</table>
<br /><br />
<input type="submit" value="Add New">
<input type="reset" value="Cancel">
</form></body>
</html>
I have then create a "send_data.asp" page that SHOULD recieve the data
and send it to the database, this is the code:

<html>
<body>

<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "C:/Inetpub/wwwroot/test.mdb"
sql="INSERT INTO customer (Surname)"
sql=sql & " VALUES "
sql=sql & "('" & Request.Form("Surname") & "')"
on error resume next
conn.Execute sql,recaffected
if err<>0 then
Response.Write("No update permissions!")
else
Response.Write("<h3>" & recaffected & " record added</h3>")
end if
conn.close
%>

</body>
</html>

HOWEVER, when i press the "Add New" button on the "form.asp" page it
takes me to the "send_data.asp" page but all it says is:

No update permissions!

As far as i know i have checked the permissions of my database file
and i have full privilages but it won't send the data.

So to summarise i can request data from my database and it works fine
but i can not send data to it (Have tried so many on line tutorials).

Would really appreciate some help (in as much detail as possible
please - where i might have gone wrong - how to resolve the problem)

Thank you in advance

Trig
Add "response.write sql" before "conn.Execute sql,recaffected".

Does the SQL statement look okay?

If so then cut-and-paste it into an MS-Access Query and run it.

It may identify the problem.

Also, I'm not familiar with your use of "recaffected".
Apr 12 '07 #5
McKirahan wrote:
>
Also, I'm not familiar with your use of "recaffected".
It's well-documented. The second argument of the Execute statement is a
byref argument that will contain the number of records affected by the
statement being executed after the execution occurs.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Apr 12 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Google Mike | last post by:
I've got RH9 Linux with default PHP. Is there a way to send email on Linux to an Exchange Server from PHP and/or other tools when there is *NOT*...
4
by: jas | last post by:
I have a basic client/server socket situation setup....where the server accepts a connection and then waits for commands. On the client side, I...
2
by: Danny J. Lesandrini | last post by:
Our orders database exists inside our firewall but we have a web site hosted on an ISP server. If we wanted to give users the ability to query the...
3
by: ME | last post by:
Hi; I am getting "Unhandled Exception: System.Net.WebException: The remote server returned an erro r: (401) Unauthorized." when I am trying...
13
by: Manfred Braun | last post by:
Hi All, I am trying to understand the blocking method socket.Send(). The call blocks as expected, but does this mean, it returnes after the...
9
by: eswanson | last post by:
I have a web page I need to post a file plus some other fields to it. How can I do this from a asp.net page. I know I can send individual fields to...
13
by: Susan Beebe | last post by:
I have downloaded the code described in Microsoft article Q154078. I am trying to send raw ZPL (zebra barcode printer) code from Microsoft access....
2
by: Ryan | last post by:
Hi, I receive an access denied error (see below) when attempting to send an email with BodyFormat=MailFormat.Html from an asp.net page. Exactly...
9
by: JBuckner | last post by:
My macro uses the Send Object (VBA Item.Send) function to email a spreadsheet to an Outlook contact list. I want the function to be completely...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.