?
Solved

Function Sequence Error -

Posted on 2004-11-16
11
Medium Priority
?
1,029 Views
Last Modified: 2010-05-18
Hello, I have a program, written in clarion, which is already connected with MSSQL and Oracle. I am now trying to connect with MS Access and am having a problem.

Within my program I use blobs, for images and rtf etc....

In access, these image fields are created as ole objects. I assume this is correct. My problem is that when I try to add to this field, I get the error message 'Function Sequence Error'.

To see if the field was the right type I imported some of my data from MSSQL and there was no problem copying in the image fields from mssql to the ole object fields in access.

I could also open and view these from my program, but still could not alter them... same error message.

This is pretty important, and Im under pressure to get it done....... so any ideas?

0
Comment
Question by:obrienj
  • 5
  • 5
11 Comments
 
LVL 58

Expert Comment

by:harfang
ID: 12594349
I believe you should not use OLE fields. Check out this site:
http://www26.brinkster.com/alzowze/Blobs.asp
The author is very convincing... And there are a few examples, too.

Good Luck
0
 
LVL 26

Expert Comment

by:Alan Warren
ID: 12594545
Hi obrienj

it all depends how the data was put into the OLE fields in Access, when you open the Access table does the field  display the words 'Long Binary Data' or does it display words like 'Bitmap Image' or 'Jpeg Image' etc...

Alan
0
 

Author Comment

by:obrienj
ID: 12594648
thanks for the responses...
firstly... I took a look at that webpage. At the end he is still using ole objects, but in a different way. As I have no knowledge of vb I dont really know what he is doing there....

alan..
When the table is first created it is just blank. But when I copied in from mssql it said long binary data..
what does this mean.
Should I be putting in the blobs in a different way than I did in mssql/oracle?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 26

Expert Comment

by:Alan Warren
ID: 12594703
Hi obrienj

No, in my opinion that is the best result we could hope for here, it is definately blob data in the field.
What is it you are actually trying to do with data in the field, do you want to extract it to file?

Alan
0
 

Author Comment

by:obrienj
ID: 12594836
Alan,
I have two types, one is an actual image and the other is rtf.

Lets take the image as thats easier, and I believe its the same problem.

lets say I give the user the right to add images to the program, so he selects through a browser and I take the image he selects and save it to the database... below is how I do it for mssql and oracle:
FPI:lobjclaid = lclaid
FPI:lobjid = lid
FPI:sPictureNAme = sPicture
FPI:bPicture{prop:size} = bBlob{prop:size}
FPI:bPicture{prop:handle} = bBlob{prop:handle}
add(fPic)

where bBlob is of type blob in clarion. And FPI: is how we reference file fields in clarion... add(fpic) is a clarion command which the odbc driver converts into sql.

This works for both. I realise that this is clarion code which you prob don't know about.. but it should work the same for all the odbc databases right? There must be something extra that I have to do for access or something
0
 
LVL 26

Expert Comment

by:Alan Warren
ID: 12595200
Hi obrienj

Im not sure I can help you with this mate, but I will try.
Does clarion support VB or VBA scripting?

If you try to only append the fields lclaid, lid and sPicture without the binary long data is your append succesful?

FPI:lobjclaid = lclaid
FPI:lobjid = lid
FPI:sPictureNAme = sPicture

Alan




0
 

Author Comment

by:obrienj
ID: 12595295
I don't think it does support vb or vb scripting... ill try and find out... if it did, how could you help?

yes it does append succesfully if I leave out the blob section....
0
 
LVL 26

Accepted Solution

by:
Alan Warren earned 1000 total points
ID: 12595614
re: yes it does append succesfully if I leave out the blob section
     was just checking to see if we had write permission on the catalog.

Using vba, vb or vbscript I can append blobs to a jet mdb, no problem, but unfortunately I dont know clarion :(
The samples in the link posted by harfang do just that, the most recent one 'new' is probably the simplest syntax.

This portion parses  the files binary data into a variable of type variant
     
      Dim objStream As ADODB.Stream
      Set objStream = CreateObject("ADODB.Stream")
      objStream.Type = adTypeBinary
      objStream.Open
      objStream.LoadFromFile sFilePath      ' path to file
      oFileBinary = objStream.Read            ' parse to the  variant variable
      objStream.Close
      Set objStream = Nothing

Then there is some use of an ado.command, but you dont really need that, you can open a recordset and append the variant variable to the blob field.

Dim objRs as  ADODB.Recordset
Set objRs = New ADODB.Recordset
objRs.Open "select * From yourtable", CurrentProject.Connection, adOpenDynamic, adLockOptimistic
With objRs
  .AddNew
  .Fields("bPicture").Value = oFileBinary
  .Update
  .Close
End With
Set objRs = Nothing



Thats the vba way of doing it.


Alan

0
 

Author Comment

by:obrienj
ID: 12595636
Okay I will try and convert this to clarion code and see what happens... ill get back to you tomorrow sometime... thanks again...
0
 
LVL 26

Expert Comment

by:Alan Warren
ID: 12595729
good luck, catch you tomorrow, I gotta get some sleep here now, 3:30am
0
 

Author Comment

by:obrienj
ID: 12624001
okay... sorry, I have tried everything and still failing. the code I am using should work, so have come to the conclusion it is a bug in the language. I will have to go for a workaround until something comes up... thanks for the help anyhow
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question