CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> General/Other

 Getting values from database

Print topic Send  topic

Author Message
stratosphere

Posts: 3
Posted: 07/24/2013, 2:05 AM

Hi,

I'm new in using CodeCharge and would like to ask on how to get the value of a column in the database and display it in a textbox and also how to save that value on another table after clicking submit button.

This is the code that I used to get the value:

Function reimbursement_TextBox4_BeforeShow(Sender)

reimbursement.TextBox4.Value = CCDLookUp("sm_id","engineers","user_id=" & DBdbreimbursement.ToSQL(CCGetUserID(),ccsText), DBdbreimbursement)

End Function

I don't know if the code will lookup the correct row in my table to display the sm_id of that particular user.

table name: engineers
columns:
user_id - primary key
sm_id - need to get the value of this column.

Thanks in advance!
View profile  Send private message
Oper


Posts: 1195
Posted: 07/24/2013, 2:18 AM

ASP right?

look ok to me.

and after Excute Update or After Excute Insert
  
dim strsql,xv  
xv=CCDLookUp("sm_id","engineers","user_id=" & DBdbreimbursement.ToSQL(CCGetUserID(),ccsText), DBdbreimbursement)   
strsql="UPDATE whatevertable set xxxxx=" & xv & " where whatevercondition"  
DBdbreimbursement.execute strsql  
may has typo doit without check syntax



_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)

http://www.PremiumWebTemplate.com
Affiliation Web Site Templates

Please do backup first
View profile  Send private message
stratosphere

Posts: 3
Posted: 07/24/2013, 2:55 AM

Hi Oper,

Right on ASP. How will I know if the value on BeforeShow code is correct? There were no errors but I cannot confirm if I'm getting values from it.

Will try the code for Excute Update or After Excute Insert and will get back to you once I'm done.

Thanks!
View profile  Send private message
stratosphere

Posts: 3
Posted: 07/24/2013, 6:52 PM

Hi Oper,

After clicking the submit button, the sm_id column is still null. Does it mean that the xv is not returning a value? Here is my code:

Quote :
Function reimbursement_DataSource_AfterExecuteInsert(Sender)
Dim xv,strsql

xv=CCDLookUp("sm_id","engineers","user_id=" & DBdbreimbursement.ToSQL(CCGetUserID(),ccsInteger), DBdbreimbursement)

strsql="UPDATE reimbursement set sm_id=" & xv & " where reimbursement_id="

DBdbreimbursement.execute strsql

End Function

^ Coded in Record:reimbursement after execute insert event


table: reimbursement
column:
sm_id - value of xv to be inserted here
reimbursement_id - primary key for reimbursement table. auto increment once submitted.


Thanks!
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.