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

 DoLogin Insert syntax

Print topic Send  topic

Author Message
dmhohf

Posts: 16
Posted: 12/28/2006, 6:20 PM

It's always the small things with me...

On the login Button_DoLogin "on click" server event, I added a second custom code to "insert " user info into a table. But event fails out and I get a server 500 error, and I can't even see where in the SQL it's failed on the server, using localhost/...

I can effectively return all my defined varibles: LoginID, TimeStampEntry, and Online. But doing a response.write after my SQL code fails. Any ideas what I'm coding wrong?
  
Function Login_Button_DoLogin_OnClick()  
  
' Login Code Start  
' ......  
' Login Code End  
  
Dim Connection   
Dim SQL      
Dim OnlineNum  
Dim LoginID      
Dim TimeStampEntry   
  
  OnlineNum = "1"  
  LoginID = CCGetUserLogin()      
  TimeStampEntry = Now()  
  
 SQL = "INSERT INTO tb_logins(ONLINE, LOGIN_ID, LOGIN_DATE) "& _         
        "VALUES (" & DBocmUser.ToSQL(OnlineNum, ccsInteger) & ", " & _    
                DBocmUser.ToSQL(LoginID, ccsText) & ", " & _    
                DBocmUser.ToSQL(TimeStampEntry, ccsDate) & ")"  
  
		'response.write to be commented out for production  
		Response.Write SQL  
		Response.End  
  
Set Connection = New clsDBocmUser    
Connection.Open    
If Login_DoLogin_OnClick = True And CCGetUserID<>"" Then Connection.Execute(SQL)    
Connection.Close    
Set Connection = Nothing  
  
End Function  

I can't even get response.write to spit out the (SQL) statement...

Thanks in advance
View profile  Send private message
Edd


Posts: 547
Posted: 12/28/2006, 7:23 PM

It sounds like the event has not been called.

Also check where the form passes to.

Edd
_________________
Accepting and instigating change are life's challenges.

http://www.syntech.com.au
View profile  Send private message
dmhohf

Posts: 16
Posted: 12/28/2006, 7:39 PM

Well if I put the "response.write" before I declare "SQL = " I can return my variables. So it is calling the event. And I can also go to other portions of the application and my login session is active. Thankfully I can say that it is still passing the login, but not the specific portion of the code I added.

As far as where the form redirects... the URL turns into something like:
http://my.server.com/webpage.asp?css=form

or something like that. I'm on the road right now, can't get to my box for a specific URL string.

Thanks for reply tho Edd, as always. :)
View profile  Send private message
SamRaven

Posts: 1
Posted: 01/05/2007, 8:59 AM

Did you fix it?
I'm no CCS expert - I was looking for an answer myself ..
but looking at your code.. are you not calling the same function recursively here??

If Login_DoLogin_OnClick = True And CCGetUserID<>"" Then Connection.Execute(SQL)

I would try ..

If Login.Errors.Count = 0 And CCGetUserID<>"" Then Connection.Execute(SQL)



View profile  Send private message
dmhohf

Posts: 16
Posted: 01/06/2007, 11:33 PM

I tried lots of different syntax, but the inline SQL fixed it.
  
Dim Connection  
Dim SQL    
Set Connection = New clsDBabcUser  
SQL = "INSERT INTO tb_logins(IS_ONLINE, LOGIN_ID) VALUES(1,'" & CCGetUserLogin & "')"  
Connection.Open  
If Login_Button_DoLogin_OnClick = True And CCGetUserID<>"" Then Connection.Execute(SQL)    
Connection.Close    
Set Connection = Nothing  
  
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.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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