473,467 Members | 1,592 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Problem in Inserting new data in access database , Using ASP

1 New Member
Hi

I am Trying to insert data in M S Access through ASP, but it is neither showing any error nor updating the database. Please tell me ,where i am making the mistake
code:
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <%
  3. set conn=Server.CreateObject("ADODB.Connection") 
  4. conn.open"gupta"
  5. set rs=server.createobject("ADODB.recordset")
  6. rs.activeconnection=conn
  7. rs.cursorlocation=2
  8. rs.cursortype=2
  9. rs.locktype=4
  10. rs.source="shweta_table"
  11. rs.open 
  12. rs.addnew
  13. rs("name")="kim"
  14. rs("age")="26"
  15. rs.update
  16. %>
  17. </html>
  18.  
I am using:
OS: window xp
server: IIS
Database:MS ACCESS
Browser: Internet Explorer

Also,please tell me how to insert data in database through ASP(using sql).
as when i wrote code:
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <body><%
  3. set conn=Server.CreateObject("ADODB.Connection")
  4. conn.Open "gupta"
  5. sql="INSERT INTO shweta_tables values('kim','27')" 
  6. conn.Execute sql,recaffected
  7. if err<>0 then
  8.   Response.Write("No update permissions!")
  9. else 
  10.   Response.Write("<h3>" & recaffected & " record added</h3>")
  11. end if
  12. conn.close
  13. %>
  14.  
  15. </body>
  16. </html>
  17.  
It give me 'No update permissions'

Thanks
Shweta
Oct 30 '06 #1
1 2977
timber910
39 New Member
Hi

I am Trying to insert data in M S Access through ASP, but it is neither showing any error nor updating the database. Please tell me ,where i am making the mistake
code:
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <%
  3. set conn=Server.CreateObject("ADODB.Connection") 
  4. conn.open"gupta"
  5. set rs=server.createobject("ADODB.recordset")
  6. rs.activeconnection=conn
  7. rs.cursorlocation=2
  8. rs.cursortype=2
  9. rs.locktype=4
  10. rs.source="shweta_table"
  11. rs.open 
  12. rs.addnew
  13. rs("name")="kim"
  14. rs("age")="26"
  15. rs.update
  16. %>
  17. </html>
  18.  
If I'm reading this correctly, what record is this updating? Or is it suppose to update everything in the "name" & "age" to the "kim" & "26"

I'm am guessing that the rs.source="shweta_table" needs something to attach it to a record that it suppose to be updating. Can be something like this

Expand|Select|Wrap|Line Numbers
  1. rs.source="shweta_table WHERE id = "a variable something(maybe an autonumber id)"
  2.  


I am using:
OS: window xp
server: IIS
Database:MS ACCESS
Browser: Internet Explorer

Also,please tell me how to insert data in database through ASP(using sql).
as when i wrote code:
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <body><%
  3. set conn=Server.CreateObject("ADODB.Connection")
  4. conn.Open "gupta"
  5. sql="INSERT INTO shweta_tables values('kim','27')" 
  6. conn.Execute sql,recaffected
  7. if err<>0 then
  8.   Response.Write("No update permissions!")
  9. else 
  10.   Response.Write("<h3>" & recaffected & " record added</h3>")
  11. end if
  12. conn.close
  13. %>
  14.  
  15. </body>
  16. </html>
  17.  
It give me 'No update permissions'

Thanks
Shweta

If i remember correctly the insert needs to know where you want to place the info your sending.

Expand|Select|Wrap|Line Numbers
  1. INSERT INTO shweta_tables (name, age) VALUES ('kim', '27') 
  2.  
Does that help or work?

-Will
Oct 31 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: DarthMacgyver | last post by:
Hello, I recently wrote a survey application. Each question is very similar. The first questions gives me a problem when there are multiple people taking the survey (The Database connection...
7
by: Jared Evans | last post by:
I developed a console application that will continually check a message queue to watch for any incoming data that needs to be inserted into MS SQL database. What would be a low-cost method I...
5
by: hfk0 | last post by:
Hi, I'm new to ASP.net, SQL Server and visual studio.net, and I'm having problem inserting and storing data from a web form to a SQL database. I created a simple ASP.NET web form, a simple SQL...
15
by: yzlin04 | last post by:
Hello, I'm new in vb.net. I have a problem in inserting a new row to a MS Access database table. There is no error message comes out when i run my program, but when i check my MS Access table,...
3
by: Surya | last post by:
Dear All, I have problem on inserting a record to database..Although it looked easy.. i have caught up with following issue .. please go ahead and help me to find solution I Need to insert...
20
by: dav3 | last post by:
Alright folks I am in need of a lil guidance/assistance here. I have a program which reads in a txt file. This txt file contains lines of the form January 3, 2007, 85.8 Now each line of the txt...
6
by: ashes | last post by:
Hi, I am creating an ecommerce website using Microsoft Visual Studio, VB.Net and MS Access 2003. I am new to VB.Net When someone wants to register on the website, they fill out a form and the...
2
by: AlexanderDeLarge | last post by:
Hi! I got a problem that's driving me crazy and I'm desperately in need of help. I'll explain my scenario: I'm doing a database driven site for a band, I got these tables for their discography...
2
by: hakkatil | last post by:
Hi to all, I have a page that inserts excel sheet to access database. I am using asp. What I want to do is to check the inserting record if it is in the database. Basicly checking the dublicate...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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...
0
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...
0
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...

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.