CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Login for Error

Print topic Send  topic

Author Message
softmafia

Posts: 44
Posted: 01/25/2005, 5:35 AM

I am designing a little application that pulls out customer record from a database
and the login fields are bothe integer
as in number anytime you try to log in it gives me this error

Error Type:
ADODB.Recordset (0x800A0E78)
Operation is not allowed when the object is closed.
/banking/Common.asp, line 1472

why is this happening?
below is the line 1472
code
Set Connection = New clsDBbank
Connection.Open
SQL = "SELECT customer_id, security_level FROM Accounts WHERE account_number='" & Replace(Login, "'", "''") & "' AND account_pin='" & Replace(Password, "'", "''") & "'"
Set RecordSet = Connection.Execute(SQL)
line 1472 Result = NOT RecordSet.EOF
If Result Then
Session("UserID") = RecordSet("customer_id")
Session("UserLogin") = Login
Session("GroupID") = RecordSet("security_level")




_________________
softmafia
View profile  Send private message
Nicole

Posts: 586
Posted: 01/25/2005, 6:10 AM

Hello,
Please try to use CCopenRS function instead:
  
Dim rs  
...  
CCopenRS rs, SQL, Connection.Connection, true  
This is the function from Common.asp

_________________
Regards,
Nicole
View profile  Send private message
softmafia

Posts: 44
Posted: 01/25/2005, 9:27 AM

Am not too good in ASP am, a newbie can you please explain how in details so i will know where to input the code please
_________________
softmafia
View profile  Send private message
peterr


Posts: 5971
Posted: 01/25/2005, 5:00 PM

Looks like the query wasn't executed at all and returned an error. You may want to print the error message as shown at http://docs.codecharge.com/studio/html/ProgrammingTechn...eCustomSQL.html
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Benjamin Krajmalnik
Posted: 01/25/2005, 6:46 PM

ANother method which I use (assuming SQL Server is being used and you have
Enterprise Manager) is to run the profiler so I can see the actual SQL
statement being sent to the back end,

Another option is for you to modify the code as follows:

<code>
SQL = "SELECT customer_id, security_level FROM Accounts WHERE
account_number='" & Replace(Login, "'", "''") & "' AND account_pin='" &
Replace(Password, "'", "''") & "'"

'new line of code follows
Response.Write SQL
Set RecordSet = Connection.Execute(SQL)

</code>

This will now display your query string on your page so you can see the
actual SQL statement.
Now, using any of the tools available to query the backend, try the query
and see if it gives you a meaningful error.

YOu are probably issuing an invalid SQL query to the backend, so it is not
being processed and as a result you are not getting a recordset back.

Nicole

Posts: 586
Posted: 01/26/2005, 2:34 AM

Hello,
In common you can try this code
  
Set Connection = New clsDBbank  
Connection.Open  
SQL = "SELECT customer_id, security_level FROM Accounts WHERE account_number='" & Replace(Login, "'", "''") & "' AND account_pin='" & Replace(Password, "'", "''") & "'"  
  
Dim rs,  
CCopenRS rs, SQL, Connection.Connection, true    
if  not rs.EOF then  
Session("UserID") =CCGetValue(rs, "customer_id")  
Session("UserLogin") = Login  
Session("GroupID") = CCGetValue(rs, "security_level")  
end if  



_________________
Regards,
Nicole
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.