IDatabaseImportBlobFromFile Method |
Copy a file into the database. Returns the blob record id.
The *.dsc file has information regarding the file mapping and what file should be imported (and where is it located).
There are 1 import description and 1 import text file available under \Examples\Import. Copy this to C:\Imp, and the example code will perform a successful import.
Namespace:
SuperOffice.COM.SuperOfficeDB
Assembly:
SuperOfficeDB.Interop (in SuperOfficeDB.Interop.dll) Version: 8.0.0.0
Syntaxint ImportBlobFromFile(
string conceptualtype,
string filename,
string extrainfo = "0",
bool zipCompress = false,
bool encrypt = false
)
Function ImportBlobFromFile (
conceptualtype As String,
filename As String,
Optional extrainfo As String = "0",
Optional zipCompress As Boolean = false,
Optional encrypt As Boolean = false
) As Integer
Dim instance As IDatabase
Dim conceptualtype As String
Dim filename As String
Dim extrainfo As String
Dim zipCompress As Boolean
Dim encrypt As Boolean
Dim returnValue As Integer
returnValue = instance.ImportBlobFromFile(conceptualtype,
filename, extrainfo, zipCompress,
encrypt)
int ImportBlobFromFile(
[InAttribute] String^ conceptualtype,
[InAttribute] String^ filename,
[InAttribute] String^ extrainfo = L"0",
[InAttribute] bool zipCompress = false,
[InAttribute] bool encrypt = false
)
Parameters
- conceptualtype
- Type: SystemString
String - type of the blob ex: PersonImage, ProjectImage... - filename
- Type: SystemString
String - name of the file to be imported - extrainfo (Optional)
- Type: SystemString
String - Additional info about the blob. - zipCompress (Optional)
- Type: SystemBoolean
Default FALSE - TRUE if the file is to be zipped (compressed) when importing - encrypt (Optional)
- Type: SystemBoolean
Default FALSE - TRUE if the file is to be encrypted when importing
Return Value
Type:
Int32True if the import was successful.
long - the id of the blob
ExamplesImport data
This text may be copied to the notepad, and saved as a *.vbs file. Remember to change the login information.
dim objdb
set objdb = CreateObject("superofficedb.database")
If Not (objDB is Nothing) Then
objdb.login "<username>", "<password>"
if (objdb.import("c:\imp\projmemb.dsc"))=true then
msgbox "import successful", vbinformation + vbokonly, "supercom"
end if
else
msgbox "unable to connect to database"
end if
set objso = nothing
Import/export a picture
dim objSO
set objSO = createobject("SuperOfficeDB.Database")
If not (objSO is nothing) Then
objSO.login "<username>", "<password>"
blobId = objSO.ImportBlobFromFile ("jpg", "c:\MyPicture.jpg")
objSO.ExportBlobToFile blobId, "c:\exportedMyPicture.jpg"
else
msgbox "Unable to log in"
end if
set objSO = Nothing
See Also