Peko
|
| Posted: 08/22/2004, 2:58 PM |
|
Dear all,
I’m new in the CodeCharge Studio’s community and not very much acquainted to the environment yet. I’m trying to implement a very simple application for exercise purpose only, which is supposed to update some registers of a server’s database (MySQL) as the user fill in some fields and press a submit button in the form. The submit button triggers a BeforeExecuteUpdate event, which copies a row from one table to another within the database. My code follows bellow:
Dim SQL
Dim ErrorMessage
Dim dbconnection
SQL = "INSERT INTO logdocexternos_item (" &_
"docexterno_item_id, " & _
"codigo, " & _
"designacao, " & _
"edicao, " & _
"edicaodata, " & _
"estado, " & _
"utilizcriacao, " & _
"datacriacao, " & _
"docexterno_id" & _
") VALUES (" & _
"(SELECT docexterno_item_id FROM docexternos_item WHERE docexterno_item_id= " & CCTOSQL(CCGetFromGet("docexterno_item_id",0),ccsinteger) & ")," &_
"(SELECT codigo FROM docexternos_item WHERE docexterno_item_id= " & CCTOSQL(CCGetFromGet("docexterno_item_id",0),ccsinteger) & ")," &_
"(SELECT designacao FROM docexternos_item WHERE docexterno_item_id= " & CCTOSQL(CCGetFromGet("docexterno_item_id",0),ccsinteger) & ")," &_
"(SELECT edicao FROM docexternos_item WHERE docexterno_item_id= " & CCTOSQL(CCGetFromGet("docexterno_item_id",0),ccsinteger) & ")," &_
"(SELECT edicaodata FROM docexternos_item WHERE docexterno_item_id= " & CCTOSQL(CCGetFromGet("docexterno_item_id",0),ccsinteger) & ")," &_
"(SELECT estado FROM docexternos_item WHERE docexterno_item_id= " & CCTOSQL(CCGetFromGet("docexterno_item_id",0),ccsinteger) & ")," &_
"(SELECT utilizcriacao FROM docexternos_item WHERE docexterno_item_id= " & CCTOSQL(CCGetFromGet("docexterno_item_id",0),ccsinteger) & ")," &_
"(SELECT datacriacao FROM docexternos_item WHERE docexterno_item_id= " & CCTOSQL(CCGetFromGet("docexterno_item_id",0),ccsinteger) & ")," &_
"(SELECT docexterno_id FROM docexternos_item WHERE docexterno_item_id= " & CCTOSQL(CCGetFromGet("docexterno_item_id",0),ccsinteger) & ")," &_
");"
Set dbconnection = New clsDBMySQL_DocExternos
dbconnection.Open
dbconnection.Execute(SQL)
ErrorMessage=CCProcessError(dbconnection)
dbconnection.Close
Set dbconnection = Nothing
On Error Goto 0
The problem is that Execute(SQL) doesn’t error nor updates the fields. Any suggestion is more than welcome.
Looking forward to finding a light in the end of the tunnel.
Cheers,
Peko
P.S.: Apologies for duplicates
|
|
|
 |
|