Hi guys

I have a problem in saving an image to database.

I'm using MySQL database then name of the field is "Pic" and the data type is LongBlob.

And my problem was i get an error when i don't upload an image when saving the record. then it appears an error Bad Variable type.

if i upload an image it works fine and the record is save there is no problem in saving.

Code:
Option Explicit
Dim bytData() As Byte ' Declarations



Private Sub Command3_Click()
On Error Resume Next
CommonDialog1.Filter = "All Files (*.*)|*.*|GIF Files (*.gif)|*.gif|JPEG Files (*.jpg)|*.jpg|Bitmap Files (*.bmp)|*.bmp"
CommonDialog1.ShowOpen
CommonDialog1.DialogTitle = "Select Picture"       'sets the title of it.
txtPicPath.Text = CommonDialog1.FileName
Open CommonDialog1.FileName For Binary As #1
ReDim bytData(FileLen(CommonDialog1.FileName))
    Get #1, , bytData
    Close #1
End Sub



Private Sub AddFaculty()
On Error GoTo ErrorDito
    Dim strSQL As String
    Dim adoCommand As ADODB.Command
    Dim FacultyString As String
    Set adoCommand = New ADODB.Command
    FacultyString = "Faculty"
    Debug.Print bytData
    strSQL = "INSERT INTO tblFaculty (FacultyNumber,LastName,FirstName,MiddleName,Gender,UserType,Pass,Pic) VALUES(?,?,?,?,?,?,?,?)"
    With adoCommand
        .ActiveConnection = cn
        .CommandType = adCmdText
        .CommandText = strSQL
        .Prepared = True
        .Parameters.Append .CreateParameter(, adVarChar, adParamInput, 20, Text1.Text)
        .Parameters.Append .CreateParameter(, adVarChar, adParamInput, 50, Text2.Text)
        .Parameters.Append .CreateParameter(, adVarChar, adParamInput, 50, Text3.Text)
        .Parameters.Append .CreateParameter(, adVarChar, adParamInput, 50, Text4.Text)
        .Parameters.Append .CreateParameter(, adVarChar, adParamInput, 10, Combo1.Text)
        .Parameters.Append .CreateParameter(, adVarChar, adParamInput, 10, FacultyString)
        .Parameters.Append .CreateParameter(, adVarChar, adParamInput, 50, Text5.Text)
        .Parameters.Append .CreateParameter(, adVarBinary, adParamInput, 65535, bytData)
        .Execute , , adCmdText + adExecuteNoRecords 'the last two arguments makes the execution of the command faster
    End With
Set adoCommand = Nothing
MsgBox "New record  added", vbInformation
'requery the list
frmUserMenu.showlist
frmUserMenu.CountRecord
Unload Me
Exit Sub
ErrorDito:
  MsgBox Err.Description, vbCritical
End Sub
The highlighted point the error