>>lcFile = FILETOSTR( {some file} ) >> >>lcSQL = "INSERT INTO dbo.SomeTable ( VarBinCol ) VALUES ( ?m.lcFile )" >> >>=SQLEXEC( MyHandle, m.lcSQL ) >> >>* ODBC error: >>* Error Message: [Connectivity error: [Microsoft][SQL Server Native Client 11.0][SQL Server]Operand type clash: text is incompatible with varbinary(max)] >>>>I can do this with a remote view but I've already coded the routine using SPT. If there's some magic trick to make this work using SPT I'd prefer to use that.
>m.FileContents = CAST(FILETOSTR(GETFILE()) AS Blob) > >? SQLEXEC(m.MyHandle, "INSERT INTO dbo.SomeTable (VarBinCol) VALUES (?m.FileContents)") >>
lcFile = CREATEBINARY( FILETOSTR( {some file} ) ) * then the rest of my original code works as expectedYour point about MapBinary is well taken. It is not necessary when INSERTing the data as above using CREATEBINARY( ). The app that reads these embedded files does have MapBinary set .T. and it reads these embedded files as expected.