Need help with rs.AddNew

Results 1 to 2 of 2

Thread: Need help with rs.AddNew

  1. #1
    Phil Forbes Guest

    Default Need help with rs.AddNew

    I&#039ve tried with both an Access DB and on SQL Server 6.5 and I&#039ve tried using both IIS4 and IIS5. <BR><BR>Any time I use the AddNew method I&#039m being told that the Object or provider is not capable of performing requested operation. Is there something that has to be enabled on in IIS before AddNew is supported? Can someone help?<BR><BR>Here&#039s the code:&#060;body&#062;<BR><BR>&#060;!-- #include virtual = "/common/" --&#062;<BR><BR>&#060;%<BR>set objDBConn = Server.CreateObject("ADODB.Connection")<BR>objDBCo nn.Open "test"<BR>set rsHighSales=Server.CreateObject("ADODB.Recordset") <BR>rsHighSales.ActiveConnection = objDBConn<BR><BR>strSQL = "SELECT * FROM location"<BR>rsHighSales.Open strSQL<BR><BR><BR>rsHighSales.AddNew<BR>rsHighSale s("loc_Desc") = "Random Text"<BR>rsHighSales.Update<BR><BR>Set rsHighSales = Nothing<BR>Set objDBConn = Nothing<BR>%&#062;<BR>&#060;/body&#062;<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default Any NOT NULL key fields?

    I notice you are selecting * from location, but when you do the add, you only initialize "loc_Desc". <BR><BR>Any chance that this table has some other fields that have NOT NULL constraints? If so, your update will not work unless you assign values to those fields.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts