Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 31st, 2003, 04:00 PM
Registered User
 
Join Date: Dec 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to gsolis
Default INSERT string into a Microsoft Access Database

Hello,
   I am trying to insert values into a microsoft database, but I keep
getting the following error message: "Operation must use an updateable query" I do not know why I am getting this error.. can someone please help me?

Here is the code I have:
Dim objComm, conntemp

conntemp = "Provider=Microsoft.Jet.OLEDB.4.0;"&_
"Data Source=c:\inetpub\wwwroot\GCIESEquipment\Database\ mdns1.mdb;"&_
"Persist Security Info =False"

set objComm = Server.CreateObject("ADODB.Command")
objComm.ActiveConnection = conntemp
objComm.CommandText = "INSERT INTO defectiveEquipment(name, email, phone) VALUES " &_
                      "('" & name & "','" & email & "','" & phone &"');"
objComm.CommandType = &H0001
objComm.Execute

 
Old December 31st, 2003, 05:31 PM
Authorized User
 
Join Date: Dec 2003
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
Default

First, try selecting a current value from the db to be sure the db is properly connected (mapped)
Assuming this works, replace objComm.CommandType=&H0001
with objComm.CommandType=adCmdText

Also, be sure that any of your three variables, which I presume are set earlier in the code, have not been cast.

Let me know how you make out






Similar Threads
Thread Thread Starter Forum Replies Last Post
how to insert these string into database SpringSummer SQL Language 3 September 22nd, 2007 07:05 AM
How to save a picture in Microsoft Access Database Edward King Java Databases 0 January 4th, 2006 01:27 AM
Problem Connecting to Microsoft Access Database eric_lim_1 Classic ASP Databases 1 September 17th, 2005 03:12 AM
Microsoft Access can't open the database because. vinodkalpaka Classic ASP Components 2 August 4th, 2004 06:27 PM
Microsoft Access can't open the database because. vinodkalpaka Classic ASP Databases 2 July 24th, 2004 04:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.