Image BLOBs Please Help!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PEB
    Recognized Expert Top Contributor
    • Aug 2006
    • 1418

    #16
    Are you sure that you have those lines in your sub:


    Dim db As Database
    Dim T As Recordset

    Is this an mdb file or Adp what you use?

    Comment

    • PEB
      Recognized Expert Top Contributor
      • Aug 2006
      • 1418

      #17
      Do you have those constants?

      Option Explicit
      Const BlockSize = 32768

      Comment

      • Mikael
        New Member
        • Nov 2006
        • 16

        #18
        this is an mdb. I'm just not sure what is going on. I am doing exactly what the article says. Do you have Access 2003?

        Comment

        • PEB
          Recognized Expert Top Contributor
          • Aug 2006
          • 1418

          #19
          See if you don't have other global variables in your system named T

          Maybe in others modules!

          This can do this kind of conflicts!

          Comment

          • PEB
            Recognized Expert Top Contributor
            • Aug 2006
            • 1418

            #20
            Yeap this is just on which i've tested it! It works well here!

            Originally posted by Mikael
            this is an mdb. I'm just not sure what is going on. I am doing exactly what the article says. Do you have Access 2003?

            Comment

            • PEB
              Recognized Expert Top Contributor
              • Aug 2006
              • 1418

              #21
              Try to insert this code in empty mdb file just created...

              With only table BLOB and this module...

              Comment

              • MMcCarthy
                Recognized Expert MVP
                • Aug 2006
                • 14387

                #22
                Based on the code it seems to be using DAO for the recordsets. Check the following:

                Change

                Dim T As Recordset

                to

                Dim T As DAO.Recordset

                and

                Check that there is a version of the Microsoft DAO library selected in your references list.

                Comment

                • Mikael
                  New Member
                  • Nov 2006
                  • 16

                  #23
                  Hello all,

                  I apologize for my extremely late response. Thank you for all the help, but its still not working. I tried setting T as DAO.Recordset, but now its complaining about:

                  FileLength = T(sField).Field Size()

                  Also, I created a blank mdb and put in just the BLOB stuff, and it seemed to work. Whats up with that? I noticed when I compiled the new database it says Compile: db2.mdb (the name of the database), but when I compile the database I'm working in, it says Compile TEST. This is not the name of anything in my database.

                  Comment

                  • NeoPa
                    Recognized Expert Moderator MVP
                    • Oct 2006
                    • 32668

                    #24
                    Originally posted by Mikael
                    Hello all,

                    I apologize for my extremely late response. Thank you for all the help, but its still not working. I tried setting T as DAO.Recordset, but now its complaining about:

                    FileLength = T(sField).Field Size()

                    Also, I created a blank mdb and put in just the BLOB stuff, and it seemed to work. Whats up with that? I noticed when I compiled the new database it says Compile: db2.mdb (the name of the database), but when I compile the database I'm working in, it says Compile TEST. This is not the name of anything in my database.
                    The Compile command changes to reflect the name of your project.
                    If you hit Ctrl-R to open or switch to your Project Window and select the very top (root) of the tree, you will see the project name. It will very likely be called Test.

                    Comment

                    • Mikael
                      New Member
                      • Nov 2006
                      • 16

                      #25
                      Originally posted by NeoPa
                      The Compile command changes to reflect the name of your project.
                      If you hit Ctrl-R to open or switch to your Project Window and select the very top (root) of the tree, you will see the project name. It will very likely be called Test.
                      You are correct. Thank you. I must have went with a test copy i was working with, and never realized it.

                      But back to the matter at hand. I created a completely blank database, and the original kb article works fine. BUT, my current db will not work. The error is still the most recent.

                      Comment

                      • Mikael
                        New Member
                        • Nov 2006
                        • 16

                        #26
                        Just wanted to move this article back to the top. If nobody has a solution, how easily can I create a new database, and import all the tables, forms, etc, from my old database?

                        Comment

                        • NeoPa
                          Recognized Expert Moderator MVP
                          • Oct 2006
                          • 32668

                          #27
                          Originally posted by Mikael
                          Just wanted to move this article back to the top. If nobody has a solution, how easily can I create a new database, and import all the tables, forms, etc, from my old database?
                          Using File / Get External Data / Import... you can get all the main objects across quite easily (including Relationships).
                          Some modules will not copy across this way but that can be done by copy/pasting the code in text form.
                          Don't forget to duplicate the References too in the VBA window.
                          Lastly, check Database options and Startup data is duplicated manually.
                          Guess what - I've had to do that before ;).

                          Comment

                          • Mikael
                            New Member
                            • Nov 2006
                            • 16

                            #28
                            How could I appropriately use the kb article:



                            I would like to have a field that pulls in jpeg pictures.

                            Comment

                            • G04
                              New Member
                              • Jan 2008
                              • 2

                              #29
                              Hi there,


                              I also try to save OLE objects in a table and encountered exactly the same errors as Mickael !

                              In an empty db the KB code works fine.
                              In the db I am working on was a reference to both DAO 3.6 and also to ADO.
                              I removed the ADO reference and it worked (I only use DAO).

                              The error "Type mismatch error 13" lies in the variable T, because of the missing DAO reference or not correctly declaration of variables.

                              Instead of :
                              Code:
                              Dim db as database
                              Dim T as recordset
                              Use:
                              Code:
                              Dim db as DAO.database
                              Dim T as DAO.Recordset
                              For saving images, I intend to use a separate database and link the table to the main database for storage purposes. A good idea?

                              Brgds,

                              Comment

                              • NeoPa
                                Recognized Expert Moderator MVP
                                • Oct 2006
                                • 32668

                                #30
                                Originally posted by G04
                                For saving images, I intend to use a separate database and link the table to the main database for storage purposes. A good idea?
                                The DAO point is a good one, but already covered in post #22 I think.
                                The last is a good idea to my mind. I'm no image expert, but if I had to store images in a database I'd definitely try to store them separately from the Front-End db.

                                Comment

                                Working...