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

 Insert Records

Print topic Send  topic

Author Message
GGuzman

Posts: 10
Posted: 04/12/2004, 11:55 PM

Is it possible to insert a record after clicking on a hyperlink?

I have a grid page which displays personnel information with the ability to drill into individual records. I would like to insert a new record into a separate table each time a person clicks on each record (hyperlink).

View profile  Send private message
peterr


Posts: 5971
Posted: 04/13/2004, 11:18 AM

The act of clicking on a hyperlink is the same as typing a URL in the Web browser. It basically sends users to another page (or the same one). Therefore you can insert records when the page is being loaded/run/initialized, for example in "After Initialize" event of the page.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
GGuzman

Posts: 10
Posted: 04/15/2004, 8:20 PM

Is it possible to pass the user NT login into one of the fields? I have a generic password which grants access to a group of individuals, but I need to record exactly who is checking each record.

I know how I can retrieve the login information about the web user via ASP with Request.ServerVariables ("LOGON_USER") but I'm not sure where and how to use it within CodeCharge.

Thanks in advance for your help.
View profile  Send private message
DonB
Posted: 04/15/2004, 8:33 PM

Unless you have the page(s) secured, you won't get a LOGON_USER set - every
access will be anonymous. This means you turn off the top box in IIS
Manager ("Anonymous Access") and force them to log in (NT login). So I
think your generic id defeats this (if I understand you correctly).

--
DonB

http://www.gotodon.com/ccbth


"GGuzman" <GGuzman@forum.codecharge> wrote in message
news:6407f50ef31c0f@news.codecharge.com...
> Is it possible to pass the user NT login into one of the fields? I have a
> generic password which grants access to a group of individuals, but I need
to
> record exactly who is checking each record.
>
> I know how I can retrieve the login information about the web user via ASP
with
> Request.ServerVariables ("LOGON_USER") but I'm not sure where and how to
use it
> within CodeCharge.
>
> Thanks in advance for your help.
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

peterr


Posts: 5971
Posted: 04/16/2004, 12:02 AM

There are many way you can assign values to fields/controls.
Use custom code with syntax FieldName.Value = ...
or
use custom code with syntax FormName.FieldName.Value = ...
or
enter your function into the "Default Value" property of the control.
or
use the Action "Retrieve Value for Control" with "Source Type = Expression" and "Source Name = (your function)"

Therefore if you have a function that returns something than enter it into the "Default Value" property or assign it to the control using custom code.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
GGuzman

Posts: 10
Posted: 05/04/2004, 7:41 PM

Upon displaying a "grid" with record results, is it possible to log exactly which records are being displayed into a different table? In other words, I have to keep track of every record checked and who checked each record.

Any assistance would be greatly appreciated!
View profile  Send private message
peterr


Posts: 5971
Posted: 05/04/2004, 7:59 PM

Sure it is possible. There is a similar example at http://docs.codecharge.com/studio/html/ProgrammingTechn...eCustomSQL.html

You can execute an custom Insert SQL statement in the Before Show Row or Before Show event, depending how you're creating that log (one log record per grid record, or one log record per grid view).
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
GGuzman

Posts: 10
Posted: 05/04/2004, 8:19 PM

Are there any examples showing how I could log a new record for each grid record?
View profile  Send private message
peterr


Posts: 5971
Posted: 05/04/2004, 8:30 PM

I would use the exact example that I provided above. That example creates the log of users who modified a record. It should work just as well in a Grid. You only need to replace the variables that are there with the variables that you want to use in your own log. Each log is different therefore all such examples will be similar but may require different fields to be updated. The exact implementation depends of course on your log structure - the information that you are recording.

If you need to retrieve some values from your grid to record it in your log then use the standard Value property ( http://docs.codecharge.com/studio/html/Components/RTPro.../ASP/Value.html)
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
GGuzman

Posts: 10
Posted: 05/04/2004, 8:32 PM

Thanks for all of your help!!

Your support is great!!!!!
View profile  Send private message
GGuzman

Posts: 10
Posted: 05/13/2004, 10:27 PM

I tried the example code but I'm getting an error. Here's mine:

Function CCDRAPS_BeforeShowRow() 'CCDRAPS_BeforeShowRow @2-221481CB

'Custom Code @111-73254650
' -------------------------

Dim SQL
Dim Connection
Dim ErrorMessage

Set Connection = New clsDBConnection1
Connection.Open
SQL = "INSERT INTO HIPAADisclosures (SSAN,RequestorLogin,DisclosurePurposeID,DisclosureInformationID,DisclosureDate) VALUES ("CCDRAPS.SSAN.Value", "Request.ServerVariables("LOGON_USER")", "1", "1", "Date()")"
Connection.Execute(SQL)
ErrorMessage = CCProcessError(Connection)
Connection.Close
Set Connection = Nothing
On Error Goto 0
' -------------------------
'End Custom Code

End Function 'Close CCDRAPS_BeforeShowRow @2-54C34B28

I tried just inserting 2 of the fields in my table since all other fields had default values, but that didn't work, so I listed all fields in my insert statement and still received the same error:

Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement

Any help would be greatly appreciated!! :-(
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.

PHP Reports

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

Home   |    Search   |    Members   |    Register   |    Login


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