Function Sequence Error -

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?

obrienjAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

harfangCommented:
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
Alan WarrenApplications DeveloperCommented:
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
obrienjAuthor Commented:
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
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Alan WarrenApplications DeveloperCommented:
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
obrienjAuthor Commented:
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
Alan WarrenApplications DeveloperCommented:
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
obrienjAuthor Commented:
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
Alan WarrenApplications DeveloperCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
obrienjAuthor Commented:
Okay I will try and convert this to clarion code and see what happens... ill get back to you tomorrow sometime... thanks again...
0
Alan WarrenApplications DeveloperCommented:
good luck, catch you tomorrow, I gotta get some sleep here now, 3:30am
0
obrienjAuthor Commented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.