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 into not working

Print topic Send  topic

Author Message
Anj

Posts: 13
Posted: 07/19/2008, 8:54 PM

Hi,
I am new to the coding and would greatly appreciate some assistance. Have spent 2 days on it and going insane.

Not sure what is wrong with the code below but its not working, probably a syntax error.

I have placed it on an after execute insert event.

Dim SQL
Dim Connection
Dim ErrorMessage
Dim CurrentLogHeaderID
Dim MaxHeaderSQL

Set Connection = New clsDBConnection1
Connection.Open
MaxHeaderSQL = "SELECT Max([H-LogHeader].LogHeaderID)" &_
"FROM [H-LogHeader];"

Set CurrentLogHeaderID = Connection.Execute(MaxHeaderSQL)


SQL = "INSERT INTO [H-LogDetail] (HeaderID, [No], Description, AASID ) "&_
" SELECT [H-LogHeader].LogHeaderID, [H-LogbookChecklist].[No], [H-LogbookChecklist].Description, [H-LogHeader].AssetID "&_
" FROM [H-LogHeader] INNER JOIN [H-LogbookChecklist] ON [H-LogHeader].AssetID = [H-LogbookChecklist].AssetID;" &_
"WHERE [H-LogbookChecklist].AssetID = CCDLookup ( 'AssetID', '[H-LogHeader]', 'LogHeaderID =' & CurrentLogHeaderID, DBConnection1)"

Connection.Execute(SQL)
ErrorMessage = CCProcessError(Connection)
Connection.Close
Set Connection = Nothing
On Error Goto 0
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.