SQL Query to Access(jet) OLE Container 
Author Message
 SQL Query to Access(jet) OLE Container

Hi All,

I have an issue trying to run an SQL Script searching for string data
in an Access(Jet) OLE Object field.  I realize that Access handles the OLE
field as a LongBinary data type and Visual Basic interprets it as String
data type; but does anyone know if I can use an SQL statement to see if a
string value exists within the OLE container.

For example:
If I have a variable called Var1$ and want to find if a OLE field in my
table JOHN contains the Var1$ string then do something.....

Dim Var1$
Var1$ = "*john*"
database.recordsource = "SELECT * FROM <Table> WHERE <Field> LIKE ' " &
Var1$ & " ' "

The catch here is that the "<Field>" being searched is an Access(Jet) OLE
defined field.
Side Note ....This statement works if I am using a text field......

I can do this without using an SQL statement but I'm trying to learn SQL
programming.
Any help would be greatly appreciated.
John.



Wed, 04 Jul 2001 03:00:00 GMT  
 SQL Query to Access(jet) OLE Container
The following reply assumes that the OLE fields in question contain OLE
objects (documents) and not custom binary data.

You will probably get iffy results.  Remember that sometimes strings are
stored in files as one-byte ANSI, and sometimes as 2-byte Unicode.  I'
guessing Access would try to treat the OLE field as a Memo field containing
ANSI, though Access 2000 will probably assume it contians Unicode.



Quote:
> Hi All,

> I have an issue trying to run an SQL Script searching for string data
> in an Access(Jet) OLE Object field.  I realize that Access handles the
OLE
> field as a LongBinary data type and Visual Basic interprets it as String
> data type; but does anyone know if I can use an SQL statement to see if a
> string value exists within the OLE container.

> For example:
> If I have a variable called Var1$ and want to find if a OLE field in my
> table JOHN contains the Var1$ string then do something.....

> Dim Var1$
> Var1$ = "*john*"
> database.recordsource = "SELECT * FROM <Table> WHERE <Field> LIKE ' " &
> Var1$ & " ' "

> The catch here is that the "<Field>" being searched is an Access(Jet) OLE
> defined field.
> Side Note ....This statement works if I am using a text field......

> I can do this without using an SQL statement but I'm trying to learn SQL
> programming.
> Any help would be greatly appreciated.
> John.



Thu, 05 Jul 2001 03:00:00 GMT  
 SQL Query to Access(jet) OLE Container
Thanks for the reply. I have found this to be true.  I can get the data and
work on it from an OLE container but even checking for the LEN of an OLE
container you have tor subtract 192 characters, or196 can't remember, to
prove if it is a blank/null field.


Quote:
>The following reply assumes that the OLE fields in question contain OLE
>objects (documents) and not custom binary data.

>You will probably get iffy results.  Remember that sometimes strings are
>stored in files as one-byte ANSI, and sometimes as 2-byte Unicode.  I'
>guessing Access would try to treat the OLE field as a Memo field containing
>ANSI, though Access 2000 will probably assume it contians Unicode.



>> Hi All,

>> I have an issue trying to run an SQL Script searching for string data
>> in an Access(Jet) OLE Object field.  I realize that Access handles the
>OLE
>> field as a LongBinary data type and Visual Basic interprets it as String
>> data type; but does anyone know if I can use an SQL statement to see if a
>> string value exists within the OLE container.

>> For example:
>> If I have a variable called Var1$ and want to find if a OLE field in my
>> table JOHN contains the Var1$ string then do something.....

>> Dim Var1$
>> Var1$ = "*john*"
>> database.recordsource = "SELECT * FROM <Table> WHERE <Field> LIKE ' " &
>> Var1$ & " ' "

>> The catch here is that the "<Field>" being searched is an Access(Jet) OLE
>> defined field.
>> Side Note ....This statement works if I am using a text field......

>> I can do this without using an SQL statement but I'm trying to learn SQL
>> programming.
>> Any help would be greatly appreciated.
>> John.



Mon, 09 Jul 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Loading Word document from Access OLE field into OLE container control in VB

2. Loading Word document from Access OLE field into OLE container control in VB

3. Loading Word document from Access OLE field into OLE container control in VB

4. Writing OLE Container/Data to SQL Server VB4/6.0

5. Accessing MS Word document in OLE Container Control

6. Using VB to embed OLE Container Control's .doc into Access 2.0 table

7. Access OLE Container - DAO

8. Accessing MS Word document in OLE Container Control

9. OLE Container/VB6/ADO/MS Access

10. VB OLE Container Control data access

11. Send OLE container text to ACCESS using ADO

12. Q: OLE Container and Database OLE object field

 

 
Powered by phpBB® Forum Software