Solved

ASP insert in database problem

Posted on 2002-04-02
11
183 Views
Last Modified: 2010-04-07
<html>

<head>
<title>CONNECT</title>
</head>

<body>
<%

Dim MyConn, RS, SQL

     Set MyConn=Server.CreateObject("ADODB.Connection")
     MyConn.Open "Journal"

     SQL = "insert into tabletest (test, new, num) values ('Faisal Khan', 'Adding Records',1)"
     
     MyConn.Execute SQL
     MyConn.close
     Set MyConn = Nothing
%>
</body>

</html>


With this piece of code a get an error that says :
This operation needs to use a query that could be updated.

Could someone help me please
0
Comment
Question by:deschenesp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +2
11 Comments
 

Author Comment

by:deschenesp
ID: 6913565
I have to leave for now but will be checking often
thank's to all
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 6915703
0
 
LVL 19

Accepted Solution

by:
cheekycj earned 34 total points
ID: 6915708
0
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 

Author Comment

by:deschenesp
ID: 6919134
Thank's cheekycj,

      I'm gonna test your solution and I'll be back soon.
0
 
LVL 18

Expert Comment

by:bruno
ID: 6925428
i normally do it this way....gotta be careful of all the ' and " though...



testVal = Replace(Request.Form("test"),"'","''")
newVal = Replace(Request.Form("new"),"'","''")
numVal = Replace(Request.Form("num"),"'","''")


strSQL = "INSERT INTO tabletest (test, new, num) VALUES (" &_
         
     "'" & testVal & "', " &_
     "'" & newVal & "', " &_
     "'" & CInt(numVal) & "')"      
0
 

Expert Comment

by:SteveH012698
ID: 6936125
ASP Returns 'Operation Must Use an Updateable Query' Error (Q175168)

may be a permissions thing, check out:

http://support.microsoft.com/search/preview.aspx?scid=kb;en-us;Q175168
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6974097
ADMINISTRATION WILL BE CONTACTING YOU SHORTLY.  Moderators Computer101 or Netminder will return to finalize these if they are still open in 14 days.  Experts, please post closing recommendations before that time.

Below are your open questions as of today.  Questions which have been inactive for 21 days or longer are considered to be abandoned and for those, your options are:
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you, but may help others. You must tell the participants why you wish to do this, and allow for Expert response.  This choice will include a refund to you, and will move this question to our PAQ (Previously Asked Question) database.  If you found information outside this question thread, please add it.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question (if it has no potential value for others).
   --> Post comments for expert of your intention to delete and why
   --> YOU CANNOT DELETE A QUESTION with comments; special handling by a Moderator is required.

For special handling needs, please post a zero point question in the link below and include the URL (question QID/link) that it regards with details.
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click this link for Help Desk, Guidelines/Member Agreement and the Question/Answer process.  http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

Click you Member Profile to view your question history and please keep them updated. If you are a KnowledgePro user, use the Power Search option to find them.  

Questions which are LOCKED with a Proposed Answer but do not help you, should be rejected with comments added.  When you grade the question less than an A, please comment as to why.  This helps all involved, as well as others who may access this item in the future.  PLEASE DO NOT AWARD POINTS TO ME.

To view your open questions, please click the following link(s) and keep them all current with updates.
http://www.experts-exchange.com/questions/Q.20091543.html
http://www.experts-exchange.com/questions/Q.20133981.html
http://www.experts-exchange.com/questions/Q.20281787.html
http://www.experts-exchange.com/questions/Q.20284144.html



*****  E X P E R T S    P L E A S E  ******  Leave your closing recommendations.
If you are interested in the cleanup effort, please click this link
http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=commspt&qid=20274643 
POINTS FOR EXPERTS awaiting comments are listed in the link below
http://www.experts-exchange.com/commspt/Q.20277028.html
 
Moderators will finalize this question if in @14 days Asker has not responded.  This will be moved to the PAQ (Previously Asked Questions) at zero points, deleted or awarded.
 
Thanks everyone.
Moondancer
Moderator @ Experts Exchange
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 6977844
IMHO, 3 way split.

CJ
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6977918
Thanks, CJ.
Points have been split.
Points for brunobear -> http://www.experts-exchange.com/jsp/qShow.jsp?qid=20294998
Points for SteveH -> http://www.experts-exchange.com/jsp/qShow.jsp?qid=20294999
Moondancer - EE Moderator
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 6978607
Thank you.
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6978933
Always my pleasure to help. :)
0

Featured Post

 Watch the Recording: Learning MySQL 5.7

MySQL 5.7 has a lot of new features. If you've dabbled with an older version of MySQL, it is definitely worth learning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When deciding to adopt any help desk solutions many factors should be explored before taking decisions. This will change from business to another but in general there are some kind of rule of thumb. Here are some quick tips: Do we need only ticket…
Turn A Profile Picture Into A Cartoon Using Photoshop And Illustrator This tutorial will teach you how to make a cartoon style image out of a regular picture. I have tried to keep the tutorial as simple as possible. I used Adobe CS4 for this tuto…
The purpose of this video is to demonstrate how to connect a WordPress website to Google Analytics. This will be demonstrated using a Windows 8 PC Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php :…
The purpose of this video is to demonstrate how to insert an Iframe into WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Open Page or Post…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question