insert image in sql

  • i have a problem to insert type image in sql with front end vb 6. this is script :

    Private Sub CmdSave_Click()

        Dim ADOCmd As New ADODB.Command

        Dim ADORs As New ADODB.Recordset

        Set mstream = New ADODB.Stream

       

        With ADOCmd

            .ActiveConnection = sDSN

            .CommandText = "sp_update_photo"         .CommandType = adCmdStoredProc

            .Parameters("@ID_Card") = MIdCard.Text

            mstream.Type = adTypeBinary

            mstream.Open

            mstream.LoadFromFile strFlNm

            .Parameters("@Photo") = mstream.Read

            Set ADORs = .Execute

        End With

        Set ADORs = Nothing

        ADOCmd.ActiveConnection = Nothing

    End Sub

    Run-time error '-2147217833' [Microsoft][ODBC SQL Server Driver]String data, Right Truncation

  • This is already being addressed here







    **ASCII stupid question, get a stupid ANSI !!!**

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply