473,554 Members | 3,184 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_da ta.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.Cre ateObject("ADOD B.Connection")
conn.Provider=" Microsoft.Jet.O LEDB.4.0"
conn.Open "C:/Inetpub/wwwroot/test.mdb"
sql="INSERT INTO customer (Surname)"
sql=sql & " VALUES "
sql=sql & "('" & Request.Form("S urname") & "')"
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 6076
>>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**********@h otmail.comwrote in message
news:11******** *************@l 53g2000cwa.goog legroups.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_da ta.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.Cre ateObject("ADOD B.Connection")
conn.Provider=" Microsoft.Jet.O LEDB.4.0"
conn.Open "C:/Inetpub/wwwroot/test.mdb"
sql="INSERT INTO customer (Surname)"
sql=sql & " VALUES "
sql=sql & "('" & Request.Form("S urname") & "')"
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_machinenam e 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**********@h otmail.comwrote in message
news:11******** *************@l 53g2000cwa.goog legroups.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_da ta.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.Cre ateObject("ADOD B.Connection")
conn.Provider=" Microsoft.Jet.O LEDB.4.0"
conn.Open "C:/Inetpub/wwwroot/test.mdb"
sql="INSERT INTO customer (Surname)"
sql=sql & " VALUES "
sql=sql & "('" & Request.Form("S urname") & "')"
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.w rite sql" before "conn.Execu te 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 "recaffecte d".
Apr 12 '07 #5
McKirahan wrote:
>
Also, I'm not familiar with your use of "recaffecte d".
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
12049
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* SMTP access? Has anyone figured out a way to use PHP to get inside an OWA (Microsoft Outlook Web Access) website to send email that way? The reason I ask is because my corporate office is going...
4
9418
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 create a socket, connect to the server...then I pass the socket to a class which just reads from the socket (in a thread). class Reader(Thread): def run(self): while 1:
2
3019
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 status of their order in real time, we could just export a simple subset of data to our ISP, like customer name, order ID and status. Anyone ever do this? For example, if the status changed...
3
15729
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 to get a page via post. Code follows...
13
8064
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 underlying TCP layer got a confirmation, that the send data was received by the socket on the remote end? Can I count on that? Do I understand TCP correctly in that, it gives confirmation ? I do not...
9
3129
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 the other page, but how do I send a file to the other page, or is there something else like a stream which will be like a file. I am attempting to get a way from writing out a file and then...
13
21635
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. It works just fine if I hard code the actual data in the string being sent to the printer. However, if I prompt the user for data or if I insert data from a particular record/field in a form...
2
3482
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 the same code works fine in a console application, and also succeeds from the asp.net page with BodyFormat=MailFormat.Text. I've recently upgraded from W2K SP4 to WinXP SP2 and am using .Net...
9
28813
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 automatic but Outlook displays a security warning message (...another program is attempting to automatically email...) that requires user intervention before the macro will finish execution. Can anyone...
0
7516
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8029
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7881
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5428
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5147
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3539
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2012
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1121
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.