[PHP] Store Image in Access Database
Hi, I'm trying to store a binary file in an access database, I'm using an ole type, and I think that it's getting inserted OK. My problem is that I don't know how to pull it out... How do you select the stuff that's in an ole object out of the database and display it, a jpg, for example. I can't even get the raw data. I've tried converting it to base 16 and inserting it, but I still can't pull it out. I know how to do this in mysql, so posting that won't help. I need to know how to do this with access. Thanks Mike. --- -- * * Mike Baranski * * Security Managment Consulting * * 919-788-9200 Phone* * 919-510-0037 Fax * * [EMAIL PROTECTED] * * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Store Image in Access Database
Hi, I'm trying to store a binary file in an access database, I'm using an ole type, and I think that it's getting inserted OK. My problem is that I don't know how to pull it out... How do you select the stuff that's in an ole object out of the database and display it, a jpg, for example. I can't even get the raw data. I've tried converting it to base 16 and inserting it, but I still can't pull it out. I know how to do this in mysql, so posting that won't help. I need to know how to do this with access. Thanks Mike. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Metabse and ODBC Blobs, was [Re: Store Image in Access Database]
Sorry about the previous one, that was a mistake. I have the following code to insert a blob into an access OLE object field: if(($prepared_query=MetabasePrepareQuery($database,"UPDATE incident_blob SET data_blob=?, description='new'"))) { $binary_lob=array( "Type"=>"inputfile", "Database"=>$database, "Error"=>"", "FileName"=>"test.php" ); if(($success=MetabaseCreateLOB($binary_lob,$blob))) { MetabaseQuerySetBLOB($database,$prepared_query,1,$blob,"data_blob"); if(!MetabaseExecuteQuery($database,$prepared_query)) $error=MetabaseError($database); MetabaseDestroyLOB($blob); } else { $error=$binary_lob["Error"]; echo "Error 1 (CreateLOB): $error\n"; } MetabaseFreePreparedQuery($database,$prepared_query); } else { $error=MetabaseError($database); echo "Error 2 (Prepare): $error\n"; } I can connect and query the database otherwise, and it works fine. The problem is with the Blobs, that update statement is not getting run. There's only 1 row in the table, but the description and ole object do not get updated. If I switch the driver to use mysql as opposed to odbc, it works fine on an identical table (on linux, not windows). Any ideas? Mike B. On Wednesday 26 December 2001 02:49 pm, Manuel Lemos wrote: > Hello, > > Mike Baranski wrote: > > Hi, I'm trying to store a binary file in an access database, I'm using an > > ole type, and I think that it's getting inserted OK. My problem is that > > I don't know how to pull it out... How do you select the stuff that's in > > an ole object out of the database and display it, a jpg, for example. I > > can't even get the raw data. I've tried converting it to base 16 and > > inserting it, but I still can't pull it out. I know how to do this in > > mysql, so posting that won't help. I need to know how to do this with > > access. > > If you are using ODBC, you may want to try Metabase because it supports > BLOB fields with any ODBC driver. Metabase is Open Source and is freely > available here. > > http://phpclasses.UpperDesign.com/browse.html/package/20 > > Regards, > Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: Metabse and ODBC Blobs, was [Re: Store Image in Access Database]
OK, first, that's right out of the metabase manual, with names changed to protect the innocent. Second, the example won't work, it gives syntax errors with the MS driver on creating the test db and tables, but I fixed the DB part, but the tables still won't create themselves, it still gives errors. I've hacked it up a little bit, but it doesen't look like the test stuff will work for access. Has anyone successfully done this, and how? I cannot believe that I'm the only person who's ever stored binary data in Access, regardless of how bad of an idea it is... > Hello, > > Mike Baranski wrote: > > Sorry about the previous one, that was a mistake. > > > > I have the following code to insert a blob into an access OLE object > > field: > > I am not sure if using SQL is the appropriate way to update such object > field. > > Anyway, to make this work, such object must be of ODBC type > ODBC_LONGVARBINARY . > > Metabase can create tables with BLOB fields properly declared. You may > want to try the driver test script to see what it does and how it shows > in access. Look in lob_test.schema to see how you can define a schema > with LOB fields so Metabase manager class can create one for your needs. > > > if(($prepared_query=MetabasePrepareQuery($database,"UPDATE incident_blob > > SET data_blob=?, description='new'"))) > > { > > > > $binary_lob=array( > > > > "Type"=>"inputfile", > > "Database"=>$database, > > "Error"=>"", > > "FileName"=>"test.php" > > > > ); > > if(($success=MetabaseCreateLOB($binary_lob,$blob))) > > { > > > > MetabaseQuerySetBLOB($database,$prepared_query,1,$blob,"data_blob"); > > if(!MetabaseExecuteQuery($database,$prepared_query)) > > $error=MetabaseError($database); > > MetabaseDestroyLOB($blob); > > } > > else > > { > > $error=$binary_lob["Error"]; > > echo "Error 1 (CreateLOB): $error\n"; > > } > > MetabaseFreePreparedQuery($database,$prepared_query); > > > > } > > else > > { > > $error=MetabaseError($database); > > echo "Error 2 (Prepare): $error\n"; > > } > > > > I can connect and query the database otherwise, and it works fine. The > > problem is with the Blobs, that update statement is not getting run. > > There's only 1 row in the table, but the description and ole object do > > not get updated. If I switch the driver to use mysql as opposed to odbc, > > it works fine on an identical table (on linux, not windows). Any ideas? > > Did you verify that MetabaseExecuteQuery call above succeeds? If it does > not succeed, what is the error message that is returned? > > Regards, > Manuel Lemos > > > Mike B. > > > > On Wednesday 26 December 2001 02:49 pm, Manuel Lemos wrote: > > > Hello, > > > > > > Mike Baranski wrote: > > > > Hi, I'm trying to store a binary file in an access database, I'm > > > > using an ole type, and I think that it's getting inserted OK. My > > > > problem is that I don't know how to pull it out... How do you select > > > > the stuff that's in an ole object out of the database and display it, > > > > a jpg, for example. I can't even get the raw data. I've tried > > > > converting it to base 16 and inserting it, but I still can't pull it > > > > out. I know how to do this in mysql, so posting that won't help. I > > > > need to know how to do this with access. > > > > > > If you are using ODBC, you may want to try Metabase because it supports > > > BLOB fields with any ODBC driver. Metabase is Open Source and is freely > > > available here. > > > > > > http://phpclasses.UpperDesign.com/browse.html/package/20 > > > > > > Regards, > > > Manuel Lemos -- * * Mike Baranski * * Security Managment Consulting * * 919-788-9200 Phone* * 919-510-0037 Fax * * [EMAIL PROTECTED] * * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP Hosting Services
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello, just wondering if anyone here could recommend a good (free, if there is a good one) PHP/mysql Hosting service. I'm willing to pay some, but not more than 15 /month Thanks GPG Key located on: http://www.keyserver.net/en/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE8WVZjn0XmoxBj3PwRAizbAJ0QZETkXf+i7xx1XPpUa/0P4xnwMwCfTLLN xSXs4S0fHADWDAj+FSDR4mY= =jSpN -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Informix.so module
Has anyone gotten this working with the newest version of PHP? We have an app that uses this, and can't seem to get it to compile. Bug 15177 is marked as critical, but nothing has been done. Any idea when it'll be fixed? Mike. -- ## # Mike Baranski # # Security Management Consulting # # http://www.secmgmt.com # # 919-788-9200 # # -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Informix compile problem
I posted a fix on the bug report form, but don't know how to implement it in the configure script. Someone should add it that knows what they're doing. http://bugs.php.net/bug.php?id=15177 Mike B. -- ## # Mike Baranski # # Security Management Consulting # # http://www.secmgmt.com # # 919-788-9200 # # -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Upload file problems on Win 2K
Hi, I'm trying to fix upload file problems on Win 2K server. I've got the allow directive set to on in the PHP.ini file, and the permissions set to give everyone full access on the directory specified in the ini file. The file never shows up. I'm using code identical to working code for a linux app, but we need it to run under MS as well. The ini file seems right, are there any major differences, and is there any reason the identical code doesen't work. The file does not ever show up on the server... Thanks Mike B. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]