|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
HELP!! - Data type mismatch in criteria expressionwith 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 *********************************************************************************************************** Since you are not typing your SqlParameters, there is no indication what they
are expecting, which makes this hard to debug. You also do not have examples of data, so I cannot tell you which is not working. Make sure you are not sending a wrong type to a particular parameter by looking at what the sproc/table expects and what you are passing. The size of the variable is another potential problem (sending 100 characters into a varchar(50), for example). -- Show quoteGregory A. Beamer MVP; MCP: +I, SE, SD, DBA *************************** Think Outside the Box! *************************** "Bantha" 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 > *********************************************************************************************************** > > |
|||||||||||||||||||||||