Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Databases
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 31st, 2003, 04:00 PM
Registered User
 
Join Date: Dec 2003
Location: Schaumburg, IL, USA.
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

Reply With Quote
  #2 (permalink)  
Old December 31st, 2003, 05:31 PM
Authorized User
 
Join Date: Dec 2003
Location: Middletown, CT, USA.
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

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 09:20 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.