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