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 -> ASP

 afterexecuteupdate

Print topic Send  topic

Author Message
LW Irving
Posted: 11/20/2004, 11:23 PM

I am try to use the code at the bottom to update a second table in my data base. It is from the examples and the only changes i have made were the table name "referral" and in the value section of the SQL Statement

But I get this error


Unable to establish connection to database.
Error information:
Microsoft JET Database Engine (0x80004005)
Could not use ''; file already in use.
Other possible cause of this problem:
The database cannot be opened, most likely due to incorrect connection settings or insufficient security set on your database folder or file.
For more details please refer to http://support.microsoft.com/default.aspx?scid=kb;en-us;Q306518
_________________________________________________

THE CODE

Function Assessments_DataSource_AfterExecuteUpdate() 'Assessments_DataSource_AfterExecuteUpdate @2-9692538C

'Custom Code @105-73254650
' -------------------------

Dim SQL
Dim Connection
Dim ErrorMessage

Set Connection = New clsDBConnection1
Connection.Open
SQL = "INSERT INTO referral (next_Contact,next_contact_type) "&_
"VALUES ("& Connection.ToSQL(CCGetFromGet("Assessment_Completion_Date",0),ccsDate) &","& Connection.ToSQL(CCGetFromGet("next_contact_type",0),ccsInteger) &")"
Connection.Execute(SQL)
ErrorMessage = CCProcessError(Connection)
Connection.Close
Set Connection = Nothing
On Error Goto 0

' -------------------------
'End Custom Code

End Function 'Close Assessments_DataSource_AfterExecuteUpdate @2-54C34B28


Any ideas why I could be getting the error
peterr


Posts: 5971
Posted: 11/20/2004, 11:56 PM

Are you also getting this error when you disable/remove your custom code?
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
LW Irving
Posted: 11/21/2004, 2:03 PM

No it goes away if I remove the afterexecuteupdate function

Ithink it has to do with the values line

I am getting the values from the form I have just submitted, should i be using that getfromget

Wayne
mrachow


Posts: 509
Posted: 11/21/2004, 2:25 PM

So when the update statement which is to be executed before your insert statement works I can think of two possibilities.
Your first connection opens the database in exclusive mode or you run out of allowed connections.

Sorry Wayne, a guess only.

Reagrds,Michael
_________________
Best regards,
Michael
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.

MS Access to Web

Convert MS Access to Web.
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.