ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 2nd, 2003, 08:52 PM
aspuser25 aspuser25 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 141 aspuser25 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Unhappy insert query fails-pls help!

i am workign on asp using ms access. i am doing an insert:

<%
Dim strStoryContent
DIM RSA
DIM QUERY1

strStoryContent = Request.form("contents[]")

If Request.form("send") = "SUBMIT" then
If Request("contents[]")<>"" then
Set RSA = Server.CreateObject("ADODB.Recordset")
QUERY1 = "INSERT INTO student_content (student_id,story_id,status_student,story_original,story_word_count) VALUES ('1','100','draft','"&strStoryContent&"',4)"
RSA.open QUERY1, "dsn=school"
End If
end if
%>

its giving error:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.

where i am doing wrong? i also tried rsa.exceute>?

i further also modified my code:
<%
Dim strStoryContent
DIM RSA
DIM QUERY1
DIM Conn
dim adCmdText

adCmdText = 1
'create and open database connection
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "dsn=school"

'create comnad object
set objCmd = server.createobject("adodb.command")

strStoryContent = Request.form("contents[]")

If Request.form("send") = "SUBMIT" then
If Request("contents[]")<>"" then
'Set RSA = Server.CreateObject("ADODB.Recordset")
QUERY1 = "INSERT INTO student_content (student_id,story_id,status_student,story_original,story_word_count) VALUES ('1','100','draft','"&strStoryContent&"',4)"
set objCmd.ActiveConnection = Conn
objCmd.CommandText = Query1
objCmd.CommandType = adCmdText
'execute the command
objCmd.Execute
End If
end if
%>

now its giving error:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.

Last edited by aspuser25 : September 2nd, 2003 at 10:12 PM.

Reply With Quote
  #2  
Old September 2nd, 2003, 10:34 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,959 Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 15 h 59 m 14 sec
Reputation Power: 802
This is probably a permissions problem with your .mdb file. The web server needs read/write access to the .mdb file.

I have some more info here

http://www.dougscode.com/forum4/topic.asp?TOPIC_ID=5

Reply With Quote
  #3  
Old September 2nd, 2003, 11:20 PM
aspuser25 aspuser25 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 141 aspuser25 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Thumbs up

thanks it works now!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > insert query fails


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT