Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Access Error on OCX

Author  Topic 

memaster
Starting Member

3 Posts

Posted - 2010-07-06 : 16:22:58
Hello
I try to get the following code working:

DECLARE @object int
DECLARE @hr int
DECLARE @out varchar(8000)
EXEC @hr = sp_OACreate 'RichText.RichTextCtrl', @object OUT
print @hr
EXEC @hr = sp_OASetProperty @object, 'TextRTF', 'A'
print @hr
EXEC @hr = sp_OAGetProperty @object, 'Text', @out OUT
print @hr
EXEC @hr = sp_OADestroy @object
print @hr
print @out

But I only get this output:
-2147024891
-2147211481
-2147211482
-2147211480

I found out that the first error code is something about access. But I don't know how to fix this. Can anyone help?

Cheers

slimt_slimt
Aged Yak Warrior

746 Posts

Posted - 2010-07-07 : 01:50:57
add:


EXEC sp_OAGetErrorInfo @object

to get the error.
Go to Top of Page
   

- Advertisement -