Link to home
Start Free TrialLog in
Avatar of sikan71
sikan71

asked on

Inserting data into access database using ASP

This is the error I am getting: Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.
/wc/Addnew.asp, line 19


Here is my code:

<% @LANGUAGE=VBScript %>
<HTML>
  <HEAD>
    <TITLE> Inserting Data into a database table </TITLE>
<%
  Dim objConn, objRS, strSQL
  Dim strConnection
 
  Set objConn = Server.CreateObject("ADODB.Connection")
  strConnection = "DSN=Shoponline;Database=Shoponline.mdb;"
  strConnection = strConnection & "UID=;PWD=;"
  with objConn
      .ConnectionTimeout=20
      .Open strConnection
  end with
 
  strSQL = "INSERT INTO tblProduct (Description, Price) VALUES "
  strSQL = strSQL & "('Cannon', '15.50')"
  objConn.Execute strSQL  'no recordset returned
  objConn.Close
  set objconn=nothing
%>
</HTML>

Please help!!
ASKER CERTIFIED SOLUTION
Avatar of twhite333
twhite333

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial