Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stored Procedure Security/access problem

Status
Not open for further replies.

rdeleon

IS-IT--Management
Jun 11, 2002
114
US
I have a VB/SQL Server 7 app that I am working on.

I need to save image types to the database but I keep running into an "Invalid Input Parameter Value" error.

Here is the VB code and stored procedure:

Public Function FileToBlob(ByVal FName As String, _
lngCTXID As Long, _
Optional Threshold As Long = 1048576) As Boolean

Dim F As Long, Data() As Byte, FileSize As Long, fld As ADODB.Field

DataEnv.GetSubmissionSheet lngCTXID

If Not DataEnv.rsGetSubmissionSheet.EOF Then
With DataEnv.rsGetSubmissionSheet
Set fld = .Fields("SubSheet")
F = FreeFile
Open FName For Binary As #F
FileSize = LOF(F)
Select Case .Fields("SubSheet").Type
Case adLongVarBinary 'adLongVarBinary
If FileSize > Threshold Then
ReadToBinary F, fld, FileSize
Else
Data = InputB(FileSize, F)
fld.Value = Data
End If
End Select
Close #F
'.Close
DataEnv.UpdateSubSheet lngCTXID, fld
End With
End If

End Function


CREATE PROCEDURE dbo.spUpdateSubSheet
(
@CTXID int, @SubSheet image
)
As

Update CTXMaster

Set SubSheet = @SubSheet

Where CTXID = @CTXID
GO




Any ideas/suggestions?

Rene'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top