Home All Groups Group Topic Archive Search About

HELP!! - Data type mismatch in criteria expression

Author
21 Feb 2006 8:14 AM
Bantha
Hi i keep getting a "Data type mismatch in criteria expression. " error
with my asp page in thei sectionof code and i cant seem to find the
cause? can any one help

*******************************************CODE********************************************************


Sub Updatedatabase ()

        Strinsert = "Insert into tblgallery (Gallery_title, Gallery_item,
Author, Author_email,Comments , Gallery_Path, Gallery_thumb_PAth)
values ( @strGalleryTitle, @strGalleryItem, @strAuthor,
@strAuthorEmail, @txtcomments, @Strimage, @strThumb)"
    'Try
        Olecon = New oledbconnection ("Provider    = Microsoft.jet.oledb.4.0;
DATA source = C:\Inetpub\wwwroot\INtranetSite\Database\gallery.mdb")
        oleinsert = new oledbcommand (strinsert, olecon)
        oleinsert.parameters.add("@strgallerytitle", GalleryTitle.text)
        oleinsert.parameters.add("@strgalleryitem", GalleryItem.text)
        oleinsert.parameters.add("@strauthor", author.text)
        oleinsert.parameters.add("@strauthoremail", AuthorEmail.text)
        oleinsert.parameters.add("@txtcomments", txtcomments)
        oleinsert.parameters.add("@strimage", strimage)
        oleinsert.parameters.add("@strthumb", strthumb)
        olecon.open()
        oleinsert.executenonquery()
        olecon.close()
        'Catch exp as exception
            'label.text = exp.message
        'end try

end sub
***********************************************************************************************************

Author
21 Feb 2006 11:42 AM
Otis Mukinfus
Show quote
On 21 Feb 2006 00:14:37 -0800, "Bantha" <AlphaPas***@gmail.com> wrote:

>Hi i keep getting a "Data type mismatch in criteria expression. " error
>with my asp page in thei sectionof code and i cant seem to find the
>cause? can any one help
>
>*******************************************CODE********************************************************
>
>
> Sub Updatedatabase ()
>
>        Strinsert = "Insert into tblgallery (Gallery_title, Gallery_item,
>Author, Author_email,Comments , Gallery_Path, Gallery_thumb_PAth)
>values ( @strGalleryTitle, @strGalleryItem, @strAuthor,
>@strAuthorEmail, @txtcomments, @Strimage, @strThumb)"
>    'Try
>        Olecon = New oledbconnection ("Provider    = Microsoft.jet.oledb.4.0;
>DATA source = C:\Inetpub\wwwroot\INtranetSite\Database\gallery.mdb")
>        oleinsert = new oledbcommand (strinsert, olecon)
>        oleinsert.parameters.add("@strgallerytitle", GalleryTitle.text)
>        oleinsert.parameters.add("@strgalleryitem", GalleryItem.text)
>        oleinsert.parameters.add("@strauthor", author.text)
>        oleinsert.parameters.add("@strauthoremail", AuthorEmail.text)
>        oleinsert.parameters.add("@txtcomments", txtcomments)
>        oleinsert.parameters.add("@strimage", strimage)
>        oleinsert.parameters.add("@strthumb", strthumb)
>        olecon.open()
>        oleinsert.executenonquery()
>        olecon.close()
>        'Catch exp as exception
>            'label.text = exp.message
>        'end try
>
> end sub
>***********************************************************************************************************
Why did you post three times?

Did you mean to use oleinsert.parameters.AddWithValue?

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com

AddThis Social Bookmark Button