p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_howto thread: ADO, ASP & SQL Problem


Message #1 by JAMES <james@g...> on Thu, 30 Mar 2000 09:01:30 -0600
James, try adding "cnn.CursorLocation = adUseClient" to your connection
script where cnn=connection object.  This should allow you to AddNew
records.  

Regards - Jack Johnston
Toronto, Ontario


-----Original Message-----
From: JAMES 
Sent: March 30, 2000 10:02 AM
To: How To
Subject: [proasp_howto] ADO, ASP & SQL Problem


> I am getting the following error when my code hits the "AddNew" line:
> 
> I am using SQL as my database. 
> "The operation requested by the application is not supported by the
> provider"
> 
> I have tried using different cursor options, but no luck. Anyone have any
> ideas?
> 
> Here is the code:
> <%@ Language=VBScript %>
> <-- i#include file="adovbs.inc" -->
> <%
> Dim db
> set db = Server.Createobject("ADODB.Connection")
> db.open "DSN=eSalesmart;UID=sa;pwd=;"
> 
> set rsUsers = server.createobject("adodb.recordset")
> rsUsers.Open "Person",db, adOpenStatic
> 
> rsUsers.AddNew     <-------------------This is where it's failing
> 
> rsUsers("LastName") = Request.Form("LastName")
> rsUsers("FirstName") = Request.Form("FirstName")
> rsUsers("EmailAddress") = Request.Form("Email")
> rsUsers("Password") = Request.Form("Password")
> rsUsers("Address1") = Request.Form("Address1")
> rsUsers("Address2") = Request.Form("Address2")
> rsUsers("City") = Request.Form("City")
> rsUsers("State") = Request.Form("State")
> rsUsers("PostalCode") = Request.Form("PostalCode")
> rsUsers("Country") = Request.Form("Country")
> rsUsers("Active") = True
> rsUsers("LastLogin") = Now
> rsUsers.Update
> 
> dim strName, value
> For each sField in rsUsers.Fields
> 	strName = sField.Name
> 	value = sField.Value
> 	Session(strName) = value
> Next
> Session("bValidUser") = true
> Response.Redirect "registeredMenu.asp"
> %>
> 
> James Hendrix
> 
> 

---
You are currently subscribed to proasp_howto. 

  Return to Index