|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
thanks it works now!
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > insert query fails |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|