[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Unable to insert record into access database in asp

Posted on 2006-05-05
4
Medium Priority
?
621 Views
Last Modified: 2006-11-18
Hi.

I have a page nido_new.asp from which I key in the relevant information or select information from  database-retreived records. This page will direct to another page nido_new_ins.asp. In this page I have an include file as below:

<!--#include file="../common/connection.asp"-->

The connection.asp consist of the following code:

<%
dim oDBConn
set oDBConn=Server.CreateObject("ADODB.Connection")
'Common Server  Connection  
oDBConn.Open "DSN=pacdbs;uid=;password="

%>

In nido_new_ins, I retrive the form variables fron nido_new and put them into an sql statement.

When I try to write to access database using the following command:

sqlcmd="Insert into pacdo (pacdoid,orderfulfilmentprefix,orderfulfilmentid,do_accountid,do_calldate,do_calltimehh,do_calltimemm,do_calltypeid," & _
       "do_memberid,do_ctrequestorname,do_tripchargeid,do_workorderid,do_workordertypeid,do_appointmentdate,do_appointmenttimehh,do_appointmenttimemm,do_appointmenttimetypeid, " & _
       "do_sitename,do_siteaddress1,do_siteaddress2,do_engineercode,do_engineername,do_engineercontact,do_specialinstruction,countryid,regdate,deleteflag,pacstatusflag)" & _
       "values(" & pacdoid & ",'" & orderfulfilmentprefix & "'," & orderfulfilmentid & "," & accountid & ",#" & calldate & "#," & calltimehh & "," & _
       calltimemm & "," & calltypeid & "," & memberid & ",'" & ctrequestorname & "'," & tripchargeid & ",'" & workorderid & "'," & workordertypeid & ",#" & _
       appointmentdate & "#," & appointmenttimehh & "," & appointmenttimemm & "," & appointmenttimetype & ",'" & sitename & "','" & siteaddress1 & "','" & siteaddress2 & "','" & engineercode & "','" & _
       engineername & "','" & engineercontact & "','" & specialinstruction & "'," & countryid & ",#" & regdate & "#,0,0)"

oDBConn.Execute sqlcmd

I get an error an error below:

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.
/pacsol/admin/sys/table_change/nido/nido_new_ins.asp, line 65

Maybe because of access rights issue? Anybody can give suggestions on how to solve this problem?
There was no problem retreiving records from database, but when I try to insert new record the error occurs.

Many thanks in advance.

0
Comment
Question by:thaishin
4 Comments
 
LVL 16

Accepted Solution

by:
Wadski earned 1000 total points
ID: 16613450
Hi there thaishin,

Have a look here:

http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=107

I believe you may be most interested the bit wheich explains how to open a database in the correct mode for Writing back to.



Wadski
0
 
LVL 6

Expert Comment

by:masirof
ID: 16613589
Hi,
As Wadski told.

You should add IUSR_YOURCOMPUTERNAME user and give write privilages to the folder where your ACCESS database resides. You can do this in Security tab of your folders properties.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 16613744
>Insert into pacdo
>Operation must use an updateable query.

is pacdo a table or a view?

if it is a view, you cannot do it, you have to split the insert into a single insert per table
0
 

Author Comment

by:thaishin
ID: 16636809
thanks for the help
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

834 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