AQUANANU
Posts: 107
|
| Posted: 12/09/2007, 3:17 AM |
|
i am trying to capture the output displayed of a record form and then store it to a memo field in a table which is from another connection than the records form.
i have been able to achieve following
1. capture output
2. in before page unload i have added the following code, but the update doesnt update the memo field.
Need help!!!! pls help
======code
Dim ErrorMessage
dim r
Dim Conn
Set Conn = New clsDBConnection10
Conn.Open
Dim blhtmlcontent
blhtmlcontent=HTMLTemplate.GetHTML("main")
session("hbl"&request.QueryString("atlasid"))=blhtmlcontent
r="update atllogdetails set htmlcontent =" & blhtmlcontent & "where id=" & request.QueryString("atlasid")
session("r")=r
Conn.Execute(r)
ErrorMessage = CCProcessError(Conn)
Conn.Close
Set Conn = Nothing
On Error Goto 0
_________________
Navneet Kakkar
CEO
Positive Thinker's Inc. |
 |
 |
Oper
Posts: 1195
|
| Posted: 12/09/2007, 8:14 AM |
|
r="update atllogdetails set htmlcontent =' " & blhtmlcontent & " ' where id=" & request.QueryString("atlasid")
Single apostrophe needit, maybe you could seeit. a litle darker
aslo would be easy if you tell the error you got.
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
 |
 |
AQUANANU
Posts: 107
|
| Posted: 12/10/2007, 9:44 PM |
|
thanks oper but this too doesnt work.
As the contents of blhtmlcontent are HTML, we need something else.
Can anyone put light on SQL parameters.
IF possible YES Team can tell how they update in the ccs code, as i tried to figure out how they do is pretty complex, i got lots of errors and basically undefined variable using the functions ccs code does.
One small wish is if a connection option is added to custom update, it will help solving this problem as we could select any connection and any table that has to be updated, whereas as defining the parameters for custom update is already in there in ccs.
_________________
Navneet Kakkar
CEO
Positive Thinker's Inc. |
 |
 |
Edd
Posts: 547
|
| Posted: 12/10/2007, 11:28 PM |
|
Oper is on the right track but you need to parse the SQL before updateing using the "ToSQL" operators,
Your code should be
r="update atllogdetails set htmlcontent =" & Conn.ToSQL(blhtmlcontent,ccsMemo) & " where id=" & Conn.ToSQL(request.QueryString("atlasid") , ccsInteger)
Look up ToSQL in the help for more information.
Also ensure that the SQL works outside of Codecharge, half of my errors have come form typing errors.
Cheers - Edd
_________________
Accepting and instigating change are life's challenges.
http://www.syntech.com.au |
 |
 |
AQUANANU
Posts: 107
|
| Posted: 12/11/2007, 2:38 AM |
|
thanks edd, it worked 
i wud have been happier if ccs lends the code / classes already there in a function to which parameter could be passed and they could just phrase the sql, which is already being done for the record form.
_________________
Navneet Kakkar
CEO
Positive Thinker's Inc. |
 |
 |
Oper
Posts: 1195
|
| Posted: 12/12/2007, 5:11 AM |
|
Aqua is right i miss the HTML part.
also just curious why are you sending the result to a Session?
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
 |
 |
AQUANANU
Posts: 107
|
| Posted: 12/12/2007, 6:32 AM |
|
oper
i used session variable so i cud use it on the next page i.e the editor, i know it will waste lots of resources but untill it didnt get into the database i had no other option.
Well now i have removed the same and tosql works.
_________________
Navneet Kakkar
CEO
Positive Thinker's Inc. |
 |
 |
Oper
Posts: 1195
|
| Posted: 12/12/2007, 1:10 PM |
|
oki :)
was just curious
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
 |
 |