If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Problems with Access & ASp

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-12-08, 09:42
Chunky_chunks Chunky_chunks is offline
Registered User
 
Join Date: Jan 2008
Posts: 1
Problems with Access & ASp

Hi I'm not sure if i have posted this in the right place but i am having a lot of problems with on line of code with in my asp. I have connected an access database with a list of genres in a genres table (tblGenres) and then a products table (tblProducts) with the relationship of many products can have one genre and one genre to many products. I am now trying to make it so that when a user selects a genre on one page it will load another page with a list of all the products for that genre. the code that i am having particular trouble with is...
Code:
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open "SELECT * FROM tblProducts WHERE tblProducts.GenreID = " & Request.QueryString("GenreID"), objConn
The error that keeps arising in the web browser is...

Quote:
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.

/groupa3/ListProducts.asp, line 20
Any help would be much appreciated.
Reply With Quote
  #2 (permalink)  
Old 01-13-08, 12:22
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
Ok, first thing's first...

Do not use the dreaded SELECT *

So I assume GenreID is numeric within your database?
__________________
George
Twitter | Blog
Reply With Quote
  #3 (permalink)  
Old 01-14-08, 02:27
Marvels Marvels is offline
Registered User
 
Join Date: Jul 2003
Location: Amsterdam, Nederland
Posts: 449
see if this helps

Reply With Quote
  #4 (permalink)  
Old 01-14-08, 06:49
noamsmadja noamsmadja is offline
Registered User
 
Join Date: Dec 2007
Posts: 21
Try using + instead of & . I dont really think it will help but... I think i had this broblem once and it fixed it.

Last edited by noamsmadja; 01-15-08 at 03:39.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On