2 messages in com.mysql.lists.win32Is this proper?
FromSent OnAttachments
Ron Smith03 May 2005 17:25 
PF: MySQL03 May 2005 17:39 
Subject:Is this proper?
From:Ron Smith (geek@yahoo.com)
Date:05/03/2005 05:25:01 PM
List:com.mysql.lists.win32

I made the suggested changes, but still get this annoying error:

Error Type: ADODB.Recordset (0x800A0E78) Operation is not allowed when the object is closed. /writing_table_contents/friends_submit_form.asp, line 61 <==== see further down The following is from the ASP page:

dim name, address, city, state, zip, phone, objConn, objRS, sql

name=request.Form("name") address=request.Form("address") city=request.Form("city") state=request.Form("state") zip=request.Form("zip") phone=request.Form("phone")

set objConn=server.CreateObject("adodb.Connection")

' the next two lines are really all on one line objConn.connectionString="driver={MySQL ODBC 3.51
Driver};Server=localhost;database=friends_contact_info"

objConn.open

set objRS=server.CreateObject("adodb.Recordset") objRS.Open "friends", objConn, , 3 , 2

' the following is all one one line:

sql="insert into friends_contact_info.friends (Name, StreetAddress, City, State,
ZipCode, PhoneNumber) values ('"&name&"', '"&address&"', '"&city&"',
'"&state&"', '"&zip&"', '"&phone&"')"

set objRS=objConn.execute(sql)

objRS.close <=========== Line 61 set objRS=nothing objConn.close set objConn=nothing

The record goes in OK, but, it seems I can't avoid the error unless *all* four
lines are commented out.

As per instructions, I have un-quoted the word: nothing, but still get the
error. Is there any way to close without an error. I just want to cross my tees
and dot my eyes. :-)

Oh! Yes, I'm running MySQL on WinXPpro using ASP pages on localhost.

TIA

Ron

Daniel da Veiga <dani@gmail.com> wrote: Without knowing the error message it is difficult for us to help, could you post the exact error you get? What kind of tables are you using? And what is the MySQL server version? Is is running on a Windows platform? Are you using ASP.Net?

If you comment that lines you'll get warnings cause MySQL will forcelly close all open connections iddle for more than the wait_timeout and interactive_timeout variables, besides, your objects will not free the memory used, that can be dangerous after some time and maybe cause unexpected behavior.

On 5/3/05, PF: MySQL wrote:

'objRS.close ' set objRS="nothing" 'objConn.close ' set objConn="nothing"

Set object = Nothing (no quotes)

set objRS = Nothing

Always set objects to nothing when you are done with them.