picture from access database into VB 
Author Message
 picture from access database into VB

Hello.  I am writing a program and have a database with
pictures in it which are Microsoft Equations.  Essentially
I am writing a test generator and want to read these
pictures from access into a a picutre, image, ole or
something that works, but nothing will.  When you run the
program and it gets to that point you get a type mismatch
and it wont work.  Any suggestions????  Thanks

Scott



Thu, 14 Oct 2004 10:17:26 GMT  
 picture from access database into VB
Scott
Post the code

Sukesh


Quote:
> Hello.  I am writing a program and have a database with
> pictures in it which are Microsoft Equations.  Essentially
> I am writing a test generator and want to read these
> pictures from access into a a picutre, image, ole or
> something that works, but nothing will.  When you run the
> program and it gets to that point you get a type mismatch
> and it wont work.  Any suggestions????  Thanks

> Scott



Thu, 14 Oct 2004 12:05:55 GMT  
 picture from access database into VB
Here is where the connection is made

'Open the database connection.
    Set conAVB = New ADODB.Connection
    conAVB.ConnectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;" & "Persist Security
Info=False;Data Source=" & App.Path & "\test.mdb"
    conAVB.Open
    Set rsQuestionsByType = New ADODB.Recordset

'Open the SQL recordset organized by group.
    strSQL = "SELECT Questions.[QuestionID],
Questions.[Type], Questions.[A] FROM Questions"

    With rsQuestionsByType
        .CursorLocation = adUseClient
        .Open strSQL, conAVB, adOpenDynamic,
adLockOptimistic, adCmdText

and after that say you have a picture on the form that that
name is picA and within the code you just do a

picA = ![A]

when you run it and it gets to there you get a type mismatch.

Thanks
Scott

Quote:
>-----Original Message-----
>Scott
>Post the code

>Sukesh



>> Hello.  I am writing a program and have a database with
>> pictures in it which are Microsoft Equations.  Essentially
>> I am writing a test generator and want to read these
>> pictures from access into a a picutre, image, ole or
>> something that works, but nothing will.  When you run the
>> program and it gets to that point you get a type mismatch
>> and it wont work.  Any suggestions????  Thanks

>> Scott

>.



Fri, 15 Oct 2004 01:14:49 GMT  
 picture from access database into VB
Scott
1. When retrieving images/large text files, it is better to do so one at
time, so that the resources are not stretched..

    SELECT SomeImageField FROM Table WHERE ID=X

2. If you declare CursorLocation as adUseClient, the only setting for
LockType adOpenStatic (any other setting is ignored).

3. To get a image into a picturebox,

    Set Picture1.DataSource = rsQuestionsByType
    Picture1.DataField = "A"

Sukesh


Quote:
> Here is where the connection is made

> 'Open the database connection.
>     Set conAVB = New ADODB.Connection
>     conAVB.ConnectionString =
> "Provider=Microsoft.Jet.OLEDB.4.0;" & "Persist Security
> Info=False;Data Source=" & App.Path & "\test.mdb"
>     conAVB.Open
>     Set rsQuestionsByType = New ADODB.Recordset

> 'Open the SQL recordset organized by group.
>     strSQL = "SELECT Questions.[QuestionID],
> Questions.[Type], Questions.[A] FROM Questions"

>     With rsQuestionsByType
>         .CursorLocation = adUseClient
>         .Open strSQL, conAVB, adOpenDynamic,
> adLockOptimistic, adCmdText

> and after that say you have a picture on the form that that
> name is picA and within the code you just do a

> picA = ![A]

> when you run it and it gets to there you get a type mismatch.

> Thanks
> Scott
> >-----Original Message-----
> >Scott
> >Post the code

> >Sukesh



> >> Hello.  I am writing a program and have a database with
> >> pictures in it which are Microsoft Equations.  Essentially
> >> I am writing a test generator and want to read these
> >> pictures from access into a a picutre, image, ole or
> >> something that works, but nothing will.  When you run the
> >> program and it gets to that point you get a type mismatch
> >> and it wont work.  Any suggestions????  Thanks

> >> Scott

> >.



Fri, 15 Oct 2004 13:49:52 GMT  
 picture from access database into VB
you may have to use the GetChunk method to get a picture from the database
to a vb front end


Quote:
> Hello.  I am writing a program and have a database with
> pictures in it which are Microsoft Equations.  Essentially
> I am writing a test generator and want to read these
> pictures from access into a a picutre, image, ole or
> something that works, but nothing will.  When you run the
> program and it gets to that point you get a type mismatch
> and it wont work.  Any suggestions????  Thanks

> Scott



Sun, 31 Oct 2004 13:33:29 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Saving Pictures to Access Database through VB

2. How to insert pictures via VB in an MS Access Database

3. How to show picture (OLE) from Access database in VB

4. How to show picture (OLE) from Access database in VB

5. Utility to pick pictures into Access database and save its as file

6. HowTo: Get pictures out of Access database table

7. HowTo: Get pictures out of an Access Database

8. How do I update a picture on to an Access Database

9. Saving Pictures to access database.

10. Display an Access database picture field

11. Access picture database?

12. Writing pictures to Access database

 

 
Powered by phpBB® Forum Software