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 -> .NET

 after saving a new record, how to add the primary key as parameter to the url

Print topic Send  topic

Author Message
dikmus

Posts: 19
Posted: 12/28/2005, 11:46 AM

Hi,

After adding a new employee, i want to jump to a "tasks" page where i can add tasks for that new employee.
This would be easy if i could add the new employeeId (autonumber field) as a parameter when jumping to that task page.
How can this be done?

THnaks Dik
_________________
www.musit.nl
View profile  Send private message
RainerSchober

Posts: 4
Posted: 01/03/2006, 3:26 AM

Under ASP (not ASP.NET!) i did the followng:

Common.asp - Class clsDBConn (like Function Execute)
the difference is the CursorType (adOpenKeyset)

Function ExecuteKeySet(varCMD)
Dim ErrorMessage, objResult
Errors.Clear
Set objResult = Server.CreateObject("ADODB.Recordset")
objResult.CursorType = adOpenKeySet
objResult.LockType = adLockOptimistic
If TypeName(varCMD) = "Command" Then
Set varCMD.ActiveConnection = objConnection
Set objResult.Source = varCMD
LastSQL = varCMD.CommandText
Else
Set objResult.ActiveConnection = objConnection
objResult.Source = varCMD
LastSQL = varCMD
End If
On Error Resume Next
objResult.Open
Errors.AddError CCProcessError(objConnection)
On Error Goto 0
Set ExecuteKeySet = objResult
End Function

on the page where i had to use the new Autincremental Key it was like:


Set objRecordSet = objConnection.ExecuteKeySet ("SELECT TOP 1 * FROM Table1")
objRecordSet.AddNew

objRecordSet("Field1") = ...
objRecordSet("Field2") = ...
objRecordSet("Field3") = ...
objRecordSet("Field4") = ...

objRecordSet.Update

NewRecordID = objRecordSet ("ID")


maybe it works the same way with the Update-Statement generated by CodeCharge and use ExecuteKeyset instead of Execute

best regards, Rainer

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.