View Full Version : SQL question
Sizlis
01-10-2001, 06:44 AM
I'm looking for the command structure that will allow me to [UPLOAD] an image from a computer and insert into a Access database.
I'm pretty sure the OLE Object function in Access allows this but I'm not sure why my information being sent in next registering.
I use Cold Fusion to dynamically update many databases but this is the first time I've tried connecting personal info and pictures together. Any help would be great
Canis Lupus
01-20-2001, 08:58 PM
~bump
Hehe, didn't know how to answer this, but I thought someone would know if I bumped it up a bit http://www.opentechsupport.net/forums/tongue.gif
Kerash
02-17-2001, 06:26 AM
I do not know a great deal about this ' cold fusion ' you speak of. But what i do know, is a bit about access:
You cannot save design changes to an Access database while other users are sharing the Access database with you. The only way to ensure that changes are saved is by opening the Access database in exclusive mode.
In general, when you try to make a design change to a database object (except tables and queries) or an item in shared mode, Access will temporarily promote you to exclusive mode for the Access database, if you are the only user of the Access database at that time. When you save all your design changes and close all the Design view windows, Access returns the Access database to shared mode. In the interim, other users will not be able to open the Access database.
If another user has the Access database open in shared mode and you try to make a major design change, such as modifying a form, Access alerts you that you might not be able to save your changes. If another user has the Access database open in shared mode and you try to make a minor design change, such as changing printer settings, Access doesn't alert you that you might not be able to save your design changes. In both cases, you might want to wait until you are the only user of the Access database so that you can save your major design changes and Access can save your minor design changes.
A data access page is handled differently. Although creating, renaming, moving, and deleting a data access page still requires promotion to exclusive mode (because this requires changing information in the Access database), editing a data access page does not require promotion to exclusive mode (because the corresponding HTML file exists in the file system outside the database).
To create a field to store OLE objects, simply follow the steps bellow:
Open a table in Design view.
To insert the field within the table, click in the row below where you want to add the field, and then click Insert Rows on the toolbar.
To add the field to the end of the table, click in the first blank row.
In the Field Name column, type the name for the field
In the Data Type column, click the arrow and select OLE Object.
Also Note: OLE Object fields are used to store data such as Word or Excel documents, pictures, sound, and other types of binary data created in other programs. OLE objects can be linked to or embedded in a field in an Access table. You must use a control in a form or report to display the OLE object.
A little info about editing and displaying objects stored in OLE Object fields:
First switch to Form view or Datasheet view.
Move to the record where you want to insert the object, and click the OLE Object field in a Access database (.mdb), or the image column in a Access project (.adp).
On the Insert menu, click Object.
In the Insert Object dialog box, click Create New if it's not already selected, and then click the kind of object that you want to create in the Object Type box.
Select the Display As Icon check box if you want the object to appear as an icon instead of the object itself. Displaying an object as an icon can be helpful when an object contains supplementary information that doesn't have to be displayed. Displaying an object as an icon also uses significantly less HDD space.
Click OK.
Create the object by using the application that you chose in step 5, and then do one of the following:
If you created the object in place, click the form outside the bound object frame. If you click Exit on the File menu, you'll quit Access.
If the object that you created opened in a separate window, click Exit on the File menu of the OLE server app. If you're prompted to update the document, just click OK.
If you're in Form view, Access displays the object. If you're in Datasheet view, Access displays the name of the object, for example, "Bitmap Image."
If you need to edit the object, just double-click it. Blah blah blah, That should be enough information for you to get by with. Hope i've been of some assistence! Enjoy, and have fun!
------------------
Need Extra Help? http://www.kerash.org
Kerash
02-19-2001, 11:06 AM
I'm sorry i couldn't help you with ' Cold fusion ' Though. I have never heard of this application. What is it?
------------------
Need Extra Help? http://www.kerash.org
Sizlis
03-01-2001, 09:46 AM
Originally posted by Kerash:
I'm sorry i couldn't help you with ' Cold fusion ' Though. I have never heard of this application. What is it?
COld Fusion is Alliare's and now Macromedia's answer to Microsoft's ASP development.
Now for the access thing don't have any trouble making the OLE object field or even getting text updates to the database... I just can't get the Object to register to the database. Keeps updating script enteries..
Cold Fusion basically modifies HTML tags, for example.. the <input> tag used in HTML to design a input field within a form changes to <CFinput> the function is basically the same. CF also has XML interfaces which allow access to not only SQL servers but Oracle servers as well just for one example...
I put a calendar up on my site take a look.. it uses coldfusion to query a acces database http://www.sizlis.com/calendar/events.cfm
Kerash
03-09-2001, 09:45 PM
Originally posted by Sizlis:
I'm looking for the command structure that will allow me to [UPLOAD] an image from a computer and insert into a Access database.
Few things:
1. Most CE devices are limited in the amount of memory they have, so for starters, be a little careful not to use all your available space.
Now, If you program to the OLE DB layer, you can use either ILockBytes or IsequentialStream to move Binary Large Objects ( BLOB ) data in and out of the database.
Microsoft's ActiveX Data Objects for CE ( ADOCE ) also supports BLOBs. Look at GetChunk and AppendChunk on the recordset objects in ADOCE. GetChunk and AppendChunk allow you to read and write to a large object column in the database. You can use an array of bytes inside the ' variant ' through ADOCE C++.
Though, you need to make sure that you are using an updateable cursor in SQL CE to store BLOBs. That is, use a base table cursor so that the AddNew function call works nicely.
heh, here i'll give example:
{
rs.open "testing", cn, adopendynamic, adlockoptimistic, adcmdtabledirect
}
Maybe try that approach and see what happens.
Also, ' Cold Fusion ' Sounds interesting, i'll have to look into it some time.
Hope i've helped, Good luck!
------------------
Who am i? Anybody?
Exactly:)
vBulletin® v3.7.1, Copyright ©2000-2008, Jelsoft Enterprises Ltd.