HELP!! - Data type mismatch in criteria expression

B

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
***********************************************************************************************************
 
O

Otis Mukinfus

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top