Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Vfpoledb and binary parameters
Message
From
27/02/2007 22:15:11
 
 
To
26/02/2007 13:16:45
Alan Krack
Mammography Reporting System
Seattle, Washington, United States
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01198862
Message ID:
01199420
Views:
22
>I have an VB.NET application that sends a binary parameter to VFP9 database stored procedure using the vfpoledb provider.
>
>The parameter is sent as a binary value to vfpoledb but when the VFP stored procedure receives it, it is a null value.
>
>The application can communicate with SQL or VFP and when using SQL it works correctly.
>
>I have searched the web and have found some vague references that vfpoledb doesn't handle binary parameters well, but haven't found any workarounds or explanations.
>
>Does anybody know anything about this?
>
>Alan

Hi Alan,

I’ve tried it with ADO and it works fine:
CLEAR

TEXT TO cProc NOSHOW
LPARAMETERS xBlob AS Varbinary
RETURN VARTYPE(xBlob)+"("+TRANSFORM(LEN(xBlob))+")="+TRANSFORM(xBlob)
ENDTEXT 

STRTOFILE(cProc, "testbinary.prg")

oConn=createobject('ADODB.Connection')
oConn.Open([Provider=VFPOLEDB.1;Data Source=]+SYS(5)+CURDIR())
oCom = CREATEOBJECT("ADODB.Command")
oCom.ActiveConnection=oConn
oCom.CommandText="=testbinary(?)"

valToPass = REPLICATE(0h41,1000)
?VARTYPE(valToPass)

oCom.Parameters.Append(oCom.CreateParameter("val", 128, 1, LEN(valToPass),valToPass))
oRS = oCom.Execute()
?oRS.Fields(0).Value
Output:
Q
Q(1000)=414141414141414141414141414141414141414141
41414141414141414141414141414141414141414141414141
41414141414141414141414141414141414141414141414141
...
Thanks,
Aleksey.
Previous
Reply
Map
View

Click here to load this message in the networking platform