Home > database >  Pb how to save the PDF file?
Pb how to save the PDF file?

Time:09-29

Pb and SQL server how to save the PDF file?

CodePudding user response:

If it is DW saveas directly ()

CodePudding user response:

Instead of the dw import from the outside to save the PDF to SQL

CodePudding user response:

Blob bb
Bb.=ole_1 objectdata
The SQLCA. The AutoCommit=TRUE
Updateblob hejbxx
Set the PDF=: bb
Where hejbxx. Contract number=: bh
;

The SQLCA. The AutoCommit=FALSE


//commit using sqlca;
IF the Sqlca. SQLNRows & gt; 0 THEN
COMMIT;
Messagebox (' message ', 'save the success! ')
The Else
The Rollback.
Messagebox (' message 'and' file save failed! '+ sqlca. Sqlerrtext)
END the IF


Save failed, please have a look

CodePudding user response:

The building Lord what control is used to invoke the PDF

What is the content of the error message

CodePudding user response:

Ole tip save failed

CodePudding user response:

I use the following code to test it and see what error message is, in addition has been made in bb data

Blob bb
String ls_err
Bb.=ole_1 objectdata
Messagebox (" ABC ", string (len (bb)))
Updateblob hejbxx
Set the PDF=: bb
Where hejbxx. Contract number=: bh.
//commit using sqlca;
IF the Sqlca. SQLNRows & gt; 0 THEN
COMMIT;
Messagebox (' message ', 'save the success! ')
The Else
Ls_err=sqlca. Sqlerrtext
The Rollback.
Messagebox (' message 'and' file save failed! '+ ls_err)//after the rollback sqlerrtext content is the message of the rollback operation


END the IF

CodePudding user response:

Just use this tip two syntax error

CodePudding user response:

Before the code prompt
The rollback transaction request not corresponding to the begin transtion

CodePudding user response:

I use the following code to test it and see what error message is, in addition has been made in bb data

Blob bb
String ls_err
Bb.=ole_1 objectdata
Messagebox (" ABC ", string (len (bb)))
Updateblob hejbxx
Set the PDF=: bb
Where hejbxx. Contract number=: bh.
//commit using sqlca;
IF the Sqlca. SQLNRows & gt; 0 THEN
COMMIT;
Messagebox (' message ', 'save the success! ')
The Else
Ls_err=sqlca. Sqlerrtext
The Rollback.
Messagebox (' message 'and' file save failed! '+ ls_err)//after the rollback sqlerrtext content is the message of the rollback operation


END the IF


ABC=9274880

CodePudding user response:

Whether the building Lord, before executing SQL statements have database connection

Such as
//the SQLCA. DBMS="ODBC"
//the SQLCA. The AutoCommit=False
//the SQLCA. DBParm="ConnectString='DSN=test; UID=dba; The PWD=SQL '"
//
//CONNECT USING the SQLCA.
  • Related