Re: ASP and Access SQL Problem
From: Stephanie Stowe (NoSpam_at_IWishICould.com)
Date: 10/08/04
- Next message: Bob Barrows [MVP]: "Re: ErrorPage from ErrHandler"
- Previous message: Lasse Edsvik: "Re: Regular Expression for URL"
- In reply to: Micromanaged: "ASP and Access SQL Problem"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 8 Oct 2004 08:43:00 -0400
Do this. I am assuming that objConn is opened before this code is hit.
strSQL = whatever ...
objConn.Execute strSQL
And do not use the recordset at all. There is no recordset for an INSERT
statement to return anyway.
S
"Micromanaged" <novirus@nospam.org> wrote in message
news:eGcMxeLrEHA.644@tk2msftngp13.phx.gbl...
> I am attempting to insert data into an Access 2k database with the
> following in an asp page:
>
> strSQL="INSERT INTO EmpIncentive(Purple, " & _
> "Red, Orange, Yellow, Green, Blue, Clndr) " & _
> "VALUES('" & rEmployee & "', '" & rdffclt & "', '" & rrspnsetm & "', '"
> & rcrrctd & "', '" & rcstmrsrvc & "', '" & rcmmnts & "', '" & rclndr &
> "')"
>
>
> Dim objRS
> Set objRS=Server.CreateObject("ADODB.Recordset")
> objRS.Open strSQL, objConn
> objRS.Close
> Set objRS=Nothing
> objConn.Close
> Set objConn=Nothing
>
> When the user hits submit, the data from the form page is posted to a
> "Success" page where the above SQL statement is executed. The data is
> successfully inserted; however, the html/asp page that is the "Success"
> page is supposed to summarize the data for the user gives me the
> following error:
>
> Error Type:
> ADODB.Recordset (0x800A0E78)
> Operation is not allowed when the object is closed.
> /incentive/incentive.asp, line 52
>
> I commented out the objRS.Close line and things work (the line with the
> error above. Is this proper?
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!
- Next message: Bob Barrows [MVP]: "Re: ErrorPage from ErrHandler"
- Previous message: Lasse Edsvik: "Re: Regular Expression for URL"
- In reply to: Micromanaged: "ASP and Access SQL Problem"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|