Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Store OLE Object In Database Field


I want to insert a Microsoft Graph object in a "OLE Object" field in a database because I want to print a graph for each record with Crystal Reports. I think the code should be something like this:

Dim grp As Graph.Chart

set grp = CreateObject("MSGraph.Chart")

rst.edit
rst.fields("Graph").AppendChunk ???
rst.update

How do i get the data from the Graph Object to use it in the appendchunk?

I have used a OLE control "oleObject.Action = OLE_SAVE_TO_FILE" and then read the file into the field but the format is not correct.
When i paste the object through access or through OLE control bound to a Data control I get "Microsoft Graph 97 Graph" in the database and the graph is printed correctly.
But if i use "OLE_SAVE_TO_FILE" and then read the file i get "Large Binary Data" and the object doesn't get printed.

Another option could be using OLE control's "Data" property putting "CF_METAFILEPICT" in the format, but then how do I get the data pointed by "Data".

Thanks in advance.

Miguel Yarza




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Store Picture Into OLE Object Field In Access
Could someone please tell me how can I store a BMP picture into a OLE field in Access table through visual basic using DAO.

thanks

Store Vb Function In Database Field
I am busy writing a program used to calculate product date codes.
A typical date code would be: L4152D 12 05. This code is broken up as follows: The L is different for every product code. The 4 stands for the year. The 152 is the 152nd day of the year. The D stands for the shift inwhich the product was made (can also be N for nightshift) and 12 05 is the expiry date (some expiry dates have different formats). To summarise a date code stores customer specific information, date and shift of production and expiry date. I want to build this logic into a database. For each product code I can have a 1 to many relationship describing the relavant code. For example:

Product code
8652

Date Code
8652 L
8652 Year
8652 DayOfYear
8652 Shift
8652 Expiry Date

First of all how do I get the day of the year?
And how do I store a function like dayofyear in a database, I want to select the function from the database without having to interpret it before I can use it? I would also need to store functions like vbCrLf in the database.
How do I store these functions in a database?
aLiEn777

Store Picture From A Picture Box To MS Access Database Field
Hello All

I am working on a payroll project, Need to store picture of employees in database (Rightnow in Access but need version on SQL too). My query is that how to store picture from a picture box to access database field. There are a lot of stuff about store data from a picture field to another picture field but unable to find any routine for storing dtata from a picture box to picture field.

Secondly if i store picture path in database then how to send that data to Crystal Report 8. Crystal report only show stored pictures.

Now i have to finialize the project and print the Employee Cards with there photographs

A quick response is highly appriciated.

Thanking you all

ahs

Create Object Named By Database Field
Does anyone know how to create an object based on the object name being retrieved from a database: For instance:

dim rs as adodb.recordset
dim oMyClassObject as object

rs.open "Select class_name from class_table", cn

set oMyClassObject = createobject(rs(0))

oMyClassObject.RunSub

Thanks in advance

Field Name Store
Hi !

table : item
field name : itno1, Itno2.... itno3
Variable
Dim var(5) as string

I wanted to store the field name in a variable not the content

VAR(1) should contain ITNO1 so on.

syntax should be in VB6, MS-ACCESS, ADO.

Thankx

Store Time In DateTime Field In SQLServer
Code:
Dim myTime as Date

Public Function getTime(dt As Date) As Date
Dim tmpStr
tmpStr = Split(CStr(dt))

getTime = CDate(tmpStr(1))
End Function

Private Sub Command1_Click()

.....
'rs!DateIn contains a datetime value
myTime = getTime(rs!DateIn)

'myTime now contains "13:32:56"

'when I insert the value in a DateTime field in SQLServer
'the stored value is : "1900-01-01 13:32:56.000"

End Sub

any ideas of how could i deal with the above issue?
how could i store just the time in a datetime field?

Store A Excel File Into A Binary Field.
Dear all,

I have created a table with a binary field.
How can I store a excel (.xls) file into it using visual basic?
Expecting your reply.

Thanks.

Regards,
Sen

Store Date And Time In SQL Server Datetime Field
I wanted to store date and time (both in single field)
I tried following in order to store the date entered in text box in format dd/mm/yyyy

Please help

Thanks in advance
VIkAS

VB6.0 Retrieve A Field Value From Access 2000 And Store In Registry?
I want to retieve a field value from an SQLPass through query from an Access 2000 database and the store the returned value in the registry.  Without the user seeing it happen and with no user input.  I can upon access, open query, but how do i pull one value from the query and store it in the reg.?

database = database.mdb
Query and field Get_Doc.doc_lname



Open Windows Dialog Box And Store The Path Of A File In A Field.
I am trying to find out code to open windows dialog Box , when I click on a button say, Browse and I could open folders and select a file , and the path will be displayed in a field.

Reading ADSI Database With VB && Store In SQL SERVER Database
This is first time I m looking for help in any VB forum I hope I can get some useful hint or help regarding my current problem. Let me describe in brief what we want:

We have one vb application which uses the MS-SQL Server Database. We want some changes in the login screen as per our new requirement.

What we want
1)We want to add one form which will show one button called ‘Update Users’ on clicking the button application will read the current users from the ADSI and store/update in the SQL-DATABASE(User Name and password in the existing table in our database).

2) When we will start the application system checks for the current windows user name and password if same user name and password exist in the MS-SQL Server database then there is no need to show login page but if the user name or password not in the database then prompt for the Login Screen

Please help me to find out how to read the ADSI Database using the VB Application email (bestloveh@yahoo.com)

Thanks

Extract Lotus Notes Richtext Field, Store It In Mdb And Display In Picturebox
Hello there,

I am a newbie here and a newbie also in doing VB programming. From time to time I have to do some Lotus Notes programming in order to streamline our daily routine works.

Here come this time I have a problem in reading a "Pasted Image" out which resides in a Notes richtext field. It's a Notes database (R5) which holds staff information as well as their photos. Since the Notes database is managed by other dept in my company, I would like to extract those information out and put them into a MS Access database (2003) for further information processing in our department. I can managed to read out all text fields from the Notes database by using COM, but I am absolutely have no ideas how to extract the "pasted image" (not even seems to be an embbed object in the richtext field) out. So, please give me some hints if you got an idea how it can be done. Thanks in advance.

I would like to make my question more simple as follow:

1. Extract a "Pasted image" from Lotus Notes -> 2. put into Access 2003 mdb -> 3. Read out and display in VB.Net's picturebox



Thanks again.



Edited by - Alex Wong on 5/11/2005 12:11:45 AM

How Store Control Object In The Array?
How to Store Control Object in the Array in VBA ?

I try with the following code...
First try
Code:Private Function getDetails(code As Integer) As String
    Dim chDetails() As Label
    chDetails = Array(lb_ch1, lb_ch2)
    getDetails = chDetails(code).Caption
End Function
Then try
Code:Private Function getDetails(code As Integer) As String
    Dim chDetails() As Label
    chDetails = Array(lb_ch1.Object, lb_ch2.Object)
    getDetails = chDetails(code).Caption
End Function

Seem like the array store the Cation of the label instead.
I have more than 30 Labels object in the form, for some reason i can't use Select statement
Anyone could help?

Thanks

How To Store/retrive Image In OLE Object
Hi,

Could anyone help me with how to store jpeg image into ms Access 2000 database with field OLE object and how to retrieve an jpeg image database from same database.After retriving the image i want to display retrived jprg image in the picture box.

Thanks In Advance
Sachin Patil

Store ADO Connection Object In Memory
Hi Guru,

May I know is it possible to store the Opened ADODB Connection in memory of COM object? I tried it with Public variable in module but it won't shared with different instance. Just try to make it faster instead of open the connection everytime a call to db.

I also try to store disconnected recordset in memory of COM object (something like Application object in ASP) and allow other instances use the same object instead of reload the data from database. But it seems like reload everytime, when second instance come in.

thanks,
Danny

OLE Object Store/retrive From Ms Access 2000
Hi,

Could anyone help me with how to store jpeg image into ms Access 2000 database with field OLE object and how to retrieve an jpeg image database from same database.After retriving the image i want to display that image in the picture box.

Thanks In Advance
Sachin Patil

Store PDF In Database
Hello!
I need some help.
Can I store pdf files in a mysql database.

I see lots of exemples to store pictures but how can I store a pdf binary file ?

Anybody know a link to the problem ?

Thanks

How To Store In Database?
Hi all,
I have a problem regadring batabase.
I want to store some text in the specified format. ( I have showed it in the sanp "word format.jpeg" attached with my thread) I have typed the text using the "format"--> "asian layout"--> "phonetic guide" which is available in Microsfit word. But even if i copy this specified text and paste it in access database, it doesn't works. Its allignment is getting disturbed.
I have showed it in the snap "database.txt".
How can i save it in databse in the specified format?
Any anyone have the solution.
Pleaseeee help.....
Anita

How To Store Pictures In Database
Hello there,
Can u please tell how we store the pictures in the database like MS-ACCESS. and then how we can retrieve them??
Thanking you in advance

Sachin

[java:help]store Value Into Database.
1)how to store combobox's value and radiobutton's value into the database?
2)if i have a combox box that contain "customer ID" from database, once i select the value from the combo box, the "customer name" (in the textbox) refer to that "customer ID" that i select will appear automatically.

thanks

Database Image Store
dear friends,
how do i save image in access database similar to format that Northwind database use in their employee table.
thanks friends

How Do I Store A DataReport In A Database?
My question is: How do I store a DataReport in a database (MS ACCESS)?

Can I store it as a View if I have the SQL syntax that created it?

CREATE VIEW MyView (field1, field2)
AS SELECT ...
...
...

I run something like this above in a cxnAccess.Execute but I received an error of "Method execute of _Connection failed". I run it on a MS ACCESS 97 and on a MS ACCESS 2000 but the same error appeared.

Is there some other way of storing my SQL SELECT command that creates the DataReport in the MS ACCESS database?

Store Images In Database
OBJECTIVE: I have a combobox that shows a list of car names. I would like to make the car names kind of like a hyperlink that when it is clicked, a new form will show displaying image of the car.

My car names are stored in Access database. I was told that I could store images in the database and it can be linked to the car names inside, in order to do the above stated objective.

Anyone knows an easier way to do this..? Codings or links to the solution would be greatly appreciated. I heard that it is a very difficult problem to solve.

Thank you.

Store Picture In Database?
Is it possible to store picture in a database such ms access, or the path only?

Store CheckBox Value On Database
1. How can I store a database value on a SQL database's table??

I have 6 checboxes and I need to store if they are checked or not, just that... Is ther any kind of var like Access' Yes/No value?

2. Do you know where can I find any example about storing an image in the same database?

Thanks...

Store Pictures In Database
Dear all,

I want to save pictures in MS Access database through VB 6.0 . Can youplease help me with a peice of code and resources/links on net which canhelp me to do this.

I want to save as well as retrieve the files.

Thanks in advance.

Store Emails In A Database Using Vb Or Asp.net
hai ,
i am suresh. i want create an application that should store emails to access
database from a mail account.
using any one of vb or asp.net.
can you please give me some sample code for that.

How To Store Picture In Database

Hi Friends,

      I'm developing payroll package in which i want to store the photo of an employee against his ticket no..How do i go about it,i'm using oracle 8i and vb 6.0.Please suggest its urgent.Thanks in advance.

Regards,
Prashant.

How To Store /,-,. As It Is To Database - Access
Hai Friends,

    In my project, i am using decimal values. My problem is while adding those values, it is rounded & stored & while retrieving that rounded values r shown in Text box.

    I am using Access database.

I choosed Data type as number

& In General,

    Field Size is Decimal
    Format is fixed
    decimal Places is 2

In the database structure, it is shown as " 1.00 "

   If i add the value as, 3.15 & store it to database, it is stored as 3.00 & while retrieving it back it is shown as 3.

I want to store the value whatever i had given to text box.


help needed

Regards

Geetha

Edited by - Geethahiren on 5/26/2005 3:37:01 AM

How To Store Documents In A Database
hello all,

am trying to figure out how to store a word document, or an excel document or any other image or document or presentation file in a database. I dont even know if its possible, but i kinda wanna find out if it will be possible.

looking forward to hearing from all you guys.

regards

-Vinod

How To Store Picture In Database
Hi every i have following code when i want to execute the program i gives me runtime error 545
Un able to bind field or data member"Picture"
my table have three field one is Pubid and othe txtdecription which hold text and third one Picture which is type OLE to hold picture pub when i excute i get above error please help
I m using office xp acess xp

    Option Explicit
    Private cn As ADODB.Connection
    Private rs As ADODB.Recordset


    Private Sub Command1_Click()
     'making txtdescription show whats in the description field
        rs.Fields("Description") = txtDescription.Text

        
        rs.MovePrevious
          'just to make sure your at the start and so you don't get that error.
        If rs.BOF Then rs.MoveFirst
        
        FillFields
    End Sub

    Private Sub Form_Load()
        
        Set cn = New ADODB.Connection
    'make this the path to the image database.
        cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
          "Data Source= C:picdata.mdb"
        cn.Open
        'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:picdata.mdb;Persist Security Info=False
        
        Set rs = New ADODB.Recordset
        rs.Open "Table1", cn, adOpenKeyset, adLockPessimistic, adCmdTable
            
        
        FillFields 'this is a sub that I'll explain later.
    End Sub
     

    Private Sub cmdPrevious_Click()
          'making txtdescription show whats in the description field
        rs.Fields("Description") = txtDescription.Text

        
        rs.MovePrevious
          'just to make sure your at the start and so you don't get that error.
        If rs.BOF Then rs.MoveFirst
        
        FillFields
    End Sub
     


     
    Private Sub cmdNext_Click()
          'making txtdescription show whats in the description field
        rs.Fields("Description") = txtDescription.Text
        
        rs.MoveNext
        If rs.EOF Then rs.MoveLast
        
        FillFields
        
    If rs.EOF Then
        MsgBox "At last record" 'avoiding that nasty error.
    End If
    End Sub
     

     
    Private Sub cmdDelete_Click() 'this will delete the entire record.
        If Not (rs.BOF And rs.EOF) Then
            rs.Delete
            If Not (rs.BOF And rs.EOF) Then
                rs.MoveNext
                If rs.EOF Then rs.MoveLast
                FillFields
            End If
        End If
    End Sub
     
    Private Sub cmdAdd_Click()
        Dim bytData() As Byte
        Dim strDescription As String
        
        On Error GoTo err
        
        With dlgAdd 'remember the common dialog box.
              'filtering so only jpg's and gifs are shown!
            .Filter = "Picture Files (*.jpg, *.gif)/*.jpg;*.gif"
            .DialogTitle = "Select Picture" 'sets the title of it.
            .ShowOpen 'show the open dialog box.
               
              'bit to "convert" the image to binary.
            Open .FileName For Binary As #1
            ReDim bytData(FileLen(.FileName))
        End With
          
        Get #1, , bytData
        Close #1
        
          'show a input box to enter description to the description field.
        strDescription = InputBox("Enter description.", "New Picture")
        
        With rs
            .AddNew
            .Fields("Description") = strDescription 'adding record to db
            .Fields("Picture").AppendChunk bytData 'Here error occur adding the picture to the db
            .Update
        End With
        
        FillFields
        Exit Sub
    err:
        If err.Number = 32755 Then 'simple error check.
        Else
            MsgBox err.Description
            err.Clear
        End If
    End Sub
     

    Public Sub FillFields()
        If Not (rs.BOF And rs.EOF) Then
            txtDescription.Text = rs.Fields("Description")
            Set Image1.DataSource = rs 'setting image1's datasource
            Image1.DataField = "Picture" 'set its datafield.
        End If
    End Sub
     
    Private Sub Form_Unload(Cancel As Integer)
        On Error Resume Next
        rs.Close
        cn.Close
        Set rs = Nothing
        Set cn = Nothing 'closing all connections.
    End Sub

Best Place To Store The Path To My Database
All

I have a multi user access database,

My users can all access the database where it is stored on the network but what i would like to be able to do is allow an adminstrator to specify the path to the database.

I am using an MDI form so can store the path there but where (And How) is the best place to store the path to the database so I can call it at run time

Thanks

Gibbo

How To Store Image/Picture Into Database
hi,
please let me know how can I store the picture files like .JPG, .Bmp, .ICO into jetdatabase using VB6.

I define a table with one field called "img" type =memo, it won't work.
please help me to fix the problem.

thanx.

Store Picture To Database From PictureBox
Dear Sir,
I will be very glad if you can inform me how to store pictures in the database but I faced some compilition errors when use this statement: rstTemp("ps") = file_length could you please inform me what is the structure for the databse table? also I would like to know how to define recordset in order to write rstTemp("ps") = file_length without errors..
thank you very much and your quick reply is truly appreciated.


Quote:




Originally Posted by RobDog888
From RhinoBulls signature -

Save image to database

Read image from database

Store Picture To Database From PictureBox
Hello i have a question!

I have an application where i store pictures to database. I can store a picture to database using StrFile = CommonDialog.FileName (where StrFile is declared as string) and ADODB.Stream object where i load the StrFile and then through adodc properties i managed to store it into the database as BLOB.

But now i have a problem. I have an image explorer where i see all the pictures that are in a folder as thumbnails by using image as index. Then when click at one i made appear in another form where i have a picture box. How can i save the picture that i have in the picturebox into the database without using the CommonDialog.FileName?? The ADODB.Stream.LoadFromFile (want's a string). How can i do this??

Thank's!

How To Store Image In Oracle9i Database
hello friends,
i am doing a project using VB6 and oracle9i. i have to store picture in database of oracle but i dont know how to do this. help me...

Creating A Database To Store Scores?
Hey all,

I have created a game for 1st grade kids and I need a way to store the kid's highscores after they finish the game, so the other kids have something to shoot for when they play the game. I have see in other posts stuff about databases, but I know nothing about them. What would be the best way to store and then send back to my program about 600 "high scores" from 30 computers?

thanks

How Can I Store Pictures In Access Database.
how can i store pictures in access database.
I'm trying out a simple address book app using the adodc control,the problem is how to load the pic on the form in vb,then what about when i have an add button on my form , how does this work,
any hlp appreciated
thks

How To Store Pictures In Database Fields
hi friends

can anybody tell me how to store pictures in database fields
i am using access as backend

pl. help me......

Store Word Range In Database
VB opens an MS Word document and gets a range of the document (a chunk of the document). Can I save that to an Access database with all the formatting? I know you can save a whole document as binary, but can you save just a part? Or another way, can you save the exact Data from the Clipboard to a database? Possible?

How To Store And Retrieve An Image From The DataBase
Help me to retreive and store an image from the dataBase

Store And Retrieve File To And From Database Using ADO
Hi,
How can I use ADO to store and retrieve a file from a
database. What are some things that I need to know or do?

How To Store Database Records Into Array With VB.NET?
I want to retrieve all records from an MS Access table and store them into an array. Can someone give me an example of how to do that in VB.NET? Thanks in advance!

How To Store Image In Oracle Database?
Hi Everybody

how to store image in oracle database?


I am using CLOB to do that in the follwoing example But i am unable.
Plz help What wrong here

If there another way to solve my problem then plz sujest!


lokesh
lokeshnow@yahoo.com


Dim CN As ADODB.Connection
Dim rs As ADODB.Recordset
Private Sub Form_Load()
Set CN = New ADODB.Connection
CN.ConnectionString = "Provider=MSDAORA;user id=LOKESH ;password=YAHOO;DATA SOURCE=BTECH1 "
CN.CursorLocation = adUseClient
CN.Open
End Sub


Private Sub Command2_Click()

'On Error Resume Next
Set rs = New ADODB.Recordset

rs.Open "select * from IMAG", CN, adOpenDynamic, adLockOptimistic

If textbox1.Text = "" Then
Else
rs.AddNew
rs!cdata = textbox1.Text
rs.Update
MsgBox "Record Updated....", vbOKOnly
End If

End Sub



Private Sub Command1_Click()
Open "C:ARNOLD.JPG" For Binary As #1

While Not EOF(1)
Line Input #1, temp$
alltext$ = alltext$ & temp$ & vbCrLf
Wend
textbox1.Text = alltext$
Close #1

End Sub

Need To Store Database ID And Description In Combobox
I am using 5 comboboxes for data entry. Once the user has selected the description I need to get the ID that relates to the description selected without having to perform another select statement. Is there no way that I can store the ID together in the combobox with the description.
Thanks

"The answer is out there, Neo, it’s looking for you. And it will find you, if you want it to."--Trinity to Neo

How To Store File In Oracle Database
hi everyone,

i want to store and retreive file of any format into oracle database using visual basic .
can anybody help in this record.

thanx in advance
rsvn

How To Store A File Into Sql Server Database?
Hi frens,

I had been search around in the forum but i can't find any related topic that can solve my problem. The question of mine is How i can store a file ( eg. txt, doc, excel ) into a field. Im using VB6 + SQL Server database. in the table, what data type should i assign to the field that i want to store the file? varbinary or image ??

as i saw from the forum there is only have VB6 + MsAccess database. Is it the same way that i need to follow?

I hope someone here can help me. Thanks.



Renee

How To Store Null Value In Database Using Datacombo
how to store null value in database using datacombo

Copyright © 2005-08 www.BigResource.com, All rights reserved