SqlSetParameterAll with DBP_LONGBUFFER Not working on OLEDB connection with SqlServer

General discussion forum about all databases other than SqlBase.
emartinenco
Argentina
Posts: 14
Joined: 16 Apr 2019, 20:32
Location: Ushuaia, Argentina

SqlSetParameterAll with DBP_LONGBUFFER Not working on OLEDB connection with SqlServer

Post by emartinenco » 13 Dec 2022, 16:36

Hi,
I'm connecting to sqlServer with oledb or Odbc. The connection mode is optional .
When I try SqlSetParameterAll ( hcursor, DBP_LONGBUFFER , 3000000, '', TRUE ) the function return TRUE with ODBC AND FALSE with OLEDB
I'm making changes in my code for connect via ODBC or OLEDB. Some of my clients require OLDB connections.
All work fine except with this command.
For us is a no go situation. This statement is widely used throughout the code
Any suggestions?

Thanks
Enrique

User avatar
Steve Leighton
Site Admin
Site Admin
New Zealand
Posts: 338
Joined: 05 Mar 2017, 20:57
Location: Stroud, England <--> Tauranga, New Zealand

Re: SqlSetParameterAll with DBP_LONGBUFFER Not working on OLEDB connection with SqlServer

Post by Steve Leighton » 13 Dec 2022, 23:16

.
You don't need DBP_LONGBUFFER with SS OLEdB . That's why it fails - there's no such thing required.

The following test works just fine with OLEdB and Inserts as much as you can throw at it , but certainly truncates with ODBC :
With OLEdB , you just ignore the fact that SqlSetParameterAll() fails - or bypass it altogether.
OLEdB LONG Test.JPG
You do not have the required permissions to view the files attached to this post.
Greetings from New Zealand
Steve Leighton

Bankside Systems Ltd.
UK ♦ Australia ♦ New Zealand

www.banksidesystems.co.uk

Image

emartinenco
Argentina
Posts: 14
Joined: 16 Apr 2019, 20:32
Location: Ushuaia, Argentina

Re: SqlSetParameterAll with DBP_LONGBUFFER Not working on OLEDB connection with SqlServer

Post by emartinenco » 15 Dec 2022, 22:04

Thanks Steeve. I just ignore the return whith OLEBD and works fine.
Kind regards.
Enrique

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 0 guests