Solved

ASP insert in database problem

Posted on 2002-04-02
11
177 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
  • 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
 

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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
The purpose of this video is to demonstrate how to create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and SmallPDF.com Log…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…

743 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now