ADO through SQliteODBC access BLOB field return ftbytes [Edit]

After installed SQliteODBC(http://www.ch-werner.de/sqliteodbc/), with ADO through ODBC access SQLite database BLOB field, Check return type is ftbytes, not ftblob type, use CreateBlobStream Procedure "invalid class typecast" error has occurred

The codes Using  Server SQL database to connect run normal, return ftblob type, and can use CreateBlobStream to read blob stream.

  ADOQuery1.SQL.Add('SELECT * FROM ModePicture');
   Try
     ADOQuery1.Open;
     FieldType:= ADOQuery1.FieldByName('CoronaryPic').DataType;
     ShowMessage(GetEnumName(Typeinfo(TFieldType),Ord(FieldType)));
     stream := ADOQuery1.CreateBlobStream(ADOQuery1.FieldByName('CoronaryPic'),bmRead);      //invalid class typecast

Question: 1, Use ADO in the Delphi to read the BLOB field by means of SQliteODBC, how to return ftblob;
               2, The ftbytes type how to convert to TMemoryStream, this type  is fixed number of bytes .

Edited by: Li Gang on Jul 6, 2015 5:33 PM
1
Li
7/7/2015 12:34:33 AM
embarcadero.delphi.ado 597 articles. 1 followers. Follow

0 Replies
1011 Views

Similar Articles

[PageSpeed] 29

Reply:

Similar Artilces:

Convert Delphi 5 ADO App to Delphi 2007 ADO.NET
I have an appliction tha that is writen in Delphi 5 with ADOConnetion, ADOTable, and ADOQuery components. I need to upgrade to Delphi 2007 and use ADO.NET. I have the program building in with Delphi 2007. Is there anything I need to do to convert the ADO to ADO.NET? > I need to upgrade to Delphi 2007 and use ADO.NET. Why ? -- With best regards, Dmitry Arefiev AnyDAC (www.anydac.com) - Oracle, MS SQL Server, IBM DB2, MySQL, Firebird, Interbase, PostgreSQL, Sybase ASA, SQLite, MS Access, DBX, ODBC, InMem - universal high-speed native data access engine Reasons for ...

ADO to ADO.NET
I'm an ASP programmer (VBScript) moving on to ASP.NET. So far I'm using:Microsoft Visual Studio 2003ASP.NET with C#I'm working on converting my code over to C#, from VBScript. Now, here is my code in VBScript (modified to better understand it, this is a edited ugly version):Function ExecuteSQL(sqlStatement)    ConnDriver = "Provider=SQLOLEDB; Data Source = " & dbIP & "; Initial Catalog = " & dbName & "; User Id = " & dbUser & "; Password=" & dbPassword     Set connTemp = Server.CreateObject("ADODB.Connection")    c...

ASA7 ADO & Delphi ADO ?? Anyone is using it?
Any comments? Is it working? Any Problems? Thanks Hi, PR <noemail@no.com> schrieb in im Newsbeitrag: BoTThJaq$GA.89@forums.sybase.com... > Any comments? Is it working? Any Problems? I tried to connect to ASA7 via the new OLE DB - Provider and ADOExpress from Delphi 5.01. No chance. Only the error message 'Invalid Enum Value'. About the new provider I haven't heard anything good until now... Regards Frank Frank, I've experienced the same problem with the ASA 7 OLEDB Provider. I'm not sure if this is a bug in the AsaProvider or Delp...

ADO not ADO.NET
Hi, I have to connect to a db using adodb (which i select from the references). I have to retrieve the car models from the database and bind them to a listbox. I am not sure how to proceed and I can't find any articles on ADO with .net and data binding. Here is the code that i tried but it only retrieves the car model for the specified id. If I delete the id it doesn't work. Also it writes the car model in the listbox vertically such as: B M W CODE: Imports System.Data Imports ADODB Imports System.Data.OleDb Public Class listboxADO Inherits System.Web.UI...

ADO - Accessing FoxPro
I have a Delphi application that is using ADO (dbGo) to access a set of FoxPRo Tables. They are DBFs with CDX indexes. It is fairly simple - I downloaded and installed the Database drivers from M$ - and it allows me to connect. The Issue I have run into is very strange - and there must be a reason for it. Basically - I open the table up in DBFViewer2000 - and I see a field called ADDRESSLIN and another called ADDRESSLI2... I also see these field names when I open them using a Text file editor. They are the 10 Character names... However, when I open a Table or a Query...

For -Beginners multiuser interface in delphi + ADO + Access
Hello! I have Delphi, and 3 ADO components (ADOConnection, ADOQuery, DataSource) and Quantium Grid from Devexpress (or standard DbGrid - it is not important). I put the Access DATAbase file in a shared folder, made the components connection with each other, as shown in many examples for beginners in ADO and started working. Additionally I write a code to add and to remove records using standard ADOQuery methods. Not yet been realized multiuser interface - everything worked well. But now it needs to be done an d I can not figure out how to approach this problem? Read many articles about ...

ADO Filter on Integer fields(values) [Edit]
Hello I need a little help on setting a filter on an Integer field i use adotable linked access database String fields are no problem, but I just can't seem to get an Integer to work correctly. the problem is: the type of filter is string i use this code ------------------------------------------------------------------------------------------------------------------------- if edit1.Text <>'' then begin ADOTable1.Filter :='id like '+ quotedstr(edit1.Text +'*'); ADOTable1.Filtered :=true; end else ADOTable1.Filtered :=false; ----------------...

MySQL Timestamp fields via Delphi ADO?
What are my options to use timestamps via parameterized inserts and selects from Delphi's ADO components (all Delphi versions)? ...

ADO
I am able to create a table using the following code but I need to create a memo field in Microsoft Access. Anyone know how to create a memo field is greatly appreciated. Thanks in advance. Andy var Cat,Table,Col,Key: Variant; Cat := CreateOLEObject('ADOX.Catalog'); Cat.ActiveConnection := ADODatabase1.DatabaseConnect; Table := CreateOLEObject('ADOX.Table'); Table.Name := 'TEMPTABLE'; //integer - primary - autoincrement sKey := 'TEMPPROFILEID'; Col := CreateOLEObject('ADO...

ADO - create table and fields in code
I am able to create a table using the following code but I need to create a memo field in Microsoft Access. Anyone know how to create a memo field is greatly appreciated. Thanks in advance. Andy var Cat,Table,Col,Key: Variant; Cat := CreateOLEObject('ADOX.Catalog'); Cat.ActiveConnection := ADODatabase1.DatabaseConnect; Table := CreateOLEObject('ADOX.Table'); Table.Name := 'TEMPTABLE'; //integer - primary - autoincrement sKey := 'TEMPPROFILEID'; Col := CreateOLEObject('ADO...

in IOS ,how to Access sqlite BLOB and Pic field? [Edit]
in IOS ,how to Access sqlite BLOB and Pic field? Thanks Edited by: e nong on Jan 5, 2012 4:06 AM On 05.01.12 13:06, e nong wrote: > in IOS ,how to Access sqlite BLOB and Pic field? > > Thanks > > Edited by: e nong on Jan 5, 2012 4:06 AM Maybe you should take a look at this demo from Anders Ohlsson http://cc.embarcadero.com/Item/28608O ...

Field datatype for Blob with ADO and MS SQL 2005
Hello I need to store a structured datatype (TRecord) in a blob field in the sql database, in paradox I used datatype (binary) - what field datatype should be used with ms sql? regards Henrik > {quote:title=Henrik Nedergaard wrote:}{quote} > Hello > > I need to store a structured datatype (TRecord) in a blob field in the sql database, in paradox I used datatype (binary) - what field datatype should be used with ms sql? > > regards > Henrik varbinary(max) /Micke ...

DBD::ADO and Access IMAGE (OLE Object) fields...
Hello all, I'm trying to insert images into an Access database (they're small, and that's how the app was built, not my choice), but I'm running into errors. I'm using... Windows XP SP1 ActiveState Perl: This is perl, v5.8.3 built for MSWin32-x86-multi-thread DBI 1.43 DBD::ADO 2.91 Win32::OLE 0.1701 CGI 3.01 CGI::Carp 1.27 Text::CSV_XS 0.23 I'd appreciate any feedback, and would love to have a solution... Here's a complete stand-alone script that *should* work, but doesn't, quite... Oh, you'll need to find the graphics located at the ...

Opinions about ADO and ADO.NET
Hi everyone again!!! I´m used to develope applications with ADO, but now with .NET to develope a Web Application and a Mobile Web Application, I don't know if I have to use ADO.NET or continue using ADO. What Disadvantages has ADO to built Mobile Applications? In ADO I use ACCESS to create the .mdb files, Can I use .mdb files with ADO.NET? Thanks for all!! Go to ADO.NET NOW ! don't be late and you can use access in ado.net ADO.NET VB.NET/C#/ASP.NET/Oracle Designer 6i DotNet4Arab.com Building a custom web control(vb.net) Well, Thanks for your opinion, but I have...

Web resources about - ADO through SQliteODBC access BLOB field return ftbytes [Edit] - embarcadero.delphi.ado

SQLite ODBC Driver
The SQLite Database Engine provides a lightweight C library to access databasefiles using a large subset of SQL92 without the overhead of RDBMS ...

Resources last updated: 12/18/2015 10:49:56 AM