473,382 Members | 1,147 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Assigning Array to an OLE object field in access database

Hi all

I am facing a problem in storing an array of integers to an OLE object field in the database, the used code for this action is listed below:

Expand|Select|Wrap|Line Numbers
  1. Sub Import_data()
  2.  
  3.  
  4.  
  5. Dim oAccesss As New ADODB.Connection
  6. Dim oRecordset11 As New ADODB.Recordset
  7. oAccesss.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=C:\DBS.mdb;"
  8. oRecordset11.Open "Select OLEdata From Table1", oAccesss, adOpenKeyset, adLockOptimistic
  9.  
  10. Dim SS(10) As integer
  11.  
  12.  
  13.  
  14. For N = 0 To 9
  15.  
  16. SS(N) = rnd
  17. Next N
  18.  
  19. With oRecordset11
  20. .Fields.Item(0) = SS
  21.  
  22. .update
  23.  
  24. end with
  25.  
  26.  
  27.  
  28. End sub
  29.  

Kindly Advice.
Jul 15 '12 #1
5 4187
zmbd
5,501 Expert Mod 4TB
You're trying to place an array in a single field in a record source, yes?

What error are you getting...

-z
Jul 15 '12 #2
Yes You are right, I am trying to place an array in a single field, the field data type is OLE Object.

The error I get is "Type Mismatch" and the error location at line 20 in the listed above code.
Jul 15 '12 #3
zmbd
5,501 Expert Mod 4TB
I don't think you can do so in MS Access... I'll do a tad more checking in few reference books.

I guess I don't understand why you would want to store an array in an Access table. Can you explain a little more about what you hope to accomplish by doing so? Without any further information, this leads me to suspect that there may be some further normalization that the database could benifit from ( Database Normalization & Table Structures ) .
Jul 15 '12 #4
Do you think it can be done in MS SQL?
Jul 16 '12 #5
zmbd
5,501 Expert Mod 4TB
There are workarounds to store the data from an array in both MS Access and I believe in MYSQL (you'll need to query in that forum...) However, I do not believe that you will be able to store the array as native even in MYSQL.

There is the multi-value field that is new to MSAccess-(2007/2010). http://office.microsoft.com/en-us/ac...001233722.aspx

Admittedly, I haven't used this field type; however from what I have read, and the examples I've seen, I would avoid these like the plague if I were you. Anything I’ve seen these used for can be readily done using the rules for normalization!

Simply Put, arrays are, IMHO, the for-runner of database tables… so why put a table within a table?

Once again, why are you trying to store an array in a single field of a table? In a RDMS this is normally not considered best practice.

IMHO: If you are trying to store an array, more than likely the data is missing a normalization step.
-z
Jul 16 '12 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Sandi | last post by:
I have a simple problem: I have an Access database (images.mdb) that has 2 columns: one is the id of the picture (an integer) and one (column named picture) is a field of type OLE Object which...
0
by: Sandi | last post by:
I have a simple problem: I have an Access database (images.mdb) that has 2 columns: one is the id of the picture (an integer) and one (column named picture) is a field of type OLE Object which...
3
by: Sandi | last post by:
I have a simple problem: I have an Access database (images.mdb) that has 2 columns: one is the id if the picture (an integer) and one (column named picture) is a field of type OLE Object which...
3
by: Sandi | last post by:
I have a simple problem: I have an Access database (images.mdb) that has 2 columns: one is the id if the picture (an integer) and one (column named picture) is a field of type OLE Object which...
2
by: Cary | last post by:
This may reveal my poor programming skills, but here goes... I'm building a pricing tool for my business. I'm nearing the end of the project, and I've been asked to be able to save quotes in some...
0
by: babu | last post by:
Can Anybody help me about this issue, that how to retrive ole object(datatype) in MS Access database what variable i have to use to store data in VB.NET .The Format of the ole object stored like...
8
by: Mark | last post by:
Hello. I am attempting to write binary data from a file to an OLE Object field, and then write the file back out from the database. I am reading and writing the files in binary mode, and using...
1
by: Rico | last post by:
Hello, I have an ole object field (Access XP/2002) which I store images in. I have a couple of questions regarding this; is it possible to determine the image dimensions? Secondly, is there...
1
by: pagoto123 | last post by:
i want the code to read an object (ole object) from access database to a textbox in asp.net . the object might be picture or notepad (txt) here is my command MsgBox("Result found",...
3
by: RRsonawane11 | last post by:
Hi, I have store image as OLE object in access database and i wan to display that image using ASP.but problem is that binary format is displaying on page...so can i get that image in asp
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.