Current location: Hot Scripts Forums » Programming Languages » ASP » Can't find the error.


Can't find the error.

Reply
  #1 (permalink)  
Old 08-26-03, 11:51 PM
Mister B.'s Avatar
Mister B. Mister B. is offline
Wannabe Coder
 
Join Date: Jul 2003
Posts: 136
Thanks: 0
Thanked 0 Times in 0 Posts
Can't find the error.

Here is the code.
strSQL = "SELECT * FROM post WHERE pid = '"&Request("pid")&"'"



and , I get this error.. Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

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

/cubularrpg/tests.asp, line 27
and the URL there is http://www28.brinkster.com/cubularrpg/tests.asp?pid=1 This is where the error is situated.
__________________
God save us from the religious fanatics

Last edited by Mister B.; 08-27-03 at 12:58 PM.
Reply With Quote
  #2 (permalink)  
Old 08-27-03, 12:23 AM
MadDog MadDog is offline
Code Master
 
Join Date: Aug 2003
Posts: 935
Thanks: 0
Thanked 0 Times in 0 Posts
what type of field is "pid"??
__________________
Drew Gauderman
ASP - MSSQL Coder / Buisness Owner / Coder for Hire!
MSN-ICQ-AIM-YIM in Profile

http://www.iportalx.net an easy ASP portal system.
Reply With Quote
  #3 (permalink)  
Old 08-27-03, 12:57 PM
Mister B.'s Avatar
Mister B. Mister B. is offline
Wannabe Coder
 
Join Date: Jul 2003
Posts: 136
Thanks: 0
Thanked 0 Times in 0 Posts
autonumber. Post I D
__________________
God save us from the religious fanatics
Reply With Quote
  #4 (permalink)  
Old 08-27-03, 01:51 PM
Shane Shane is offline
Coding Addict
 
Join Date: Jun 2003
Location: Maryland, US
Posts: 268
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally posted by Mister B.
autonumber. Post I D
ok, well, since it's a number, then you don't need the ' in there.

so, change it to this:

strSQL = "SELECT * FROM post WHERE pid = " & Replace(Request("pid"),"'","")

Note: I put the replace function in there to protect you from SQL injection attacks. Instead of using the replace, you could check the input and make sure it's a numeric.
__________________
Shane Bauer
Microsoft Certified Professional (MCP) - ASP.NET
ASP/ASP.net, C#, VB/VB.NET, PHP, Perl, SQL
Reply With Quote
  #5 (permalink)  
Old 08-27-03, 02:19 PM
Mister B.'s Avatar
Mister B. Mister B. is offline
Wannabe Coder
 
Join Date: Jul 2003
Posts: 136
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks Shane, big help... Should have this up in no time.
__________________
God save us from the religious fanatics
Reply With Quote
  #6 (permalink)  
Old 08-27-03, 02:50 PM
MadDog MadDog is offline
Code Master
 
Join Date: Aug 2003
Posts: 935
Thanks: 0
Thanked 0 Times in 0 Posts
I was going to say that shane
__________________
Drew Gauderman
ASP - MSSQL Coder / Buisness Owner / Coder for Hire!
MSN-ICQ-AIM-YIM in Profile

http://www.iportalx.net an easy ASP portal system.
Reply With Quote
  #7 (permalink)  
Old 08-27-03, 03:27 PM
Shane Shane is offline
Coding Addict
 
Join Date: Jun 2003
Location: Maryland, US
Posts: 268
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally posted by MadDog
I was going to say that shane
haha..wellll I won.
__________________
Shane Bauer
Microsoft Certified Professional (MCP) - ASP.NET
ASP/ASP.net, C#, VB/VB.NET, PHP, Perl, SQL
Reply With Quote
  #8 (permalink)  
Old 08-27-03, 03:39 PM
Mister B.'s Avatar
Mister B. Mister B. is offline
Wannabe Coder
 
Join Date: Jul 2003
Posts: 136
Thanks: 0
Thanked 0 Times in 0 Posts
Okay guys I have it up now, I will have it debugged in the next hour or three.
__________________
God save us from the religious fanatics
Reply With Quote
  #9 (permalink)  
Old 08-27-03, 03:49 PM
Stealth Stealth is offline
1337 pr0gr4mm3r
 
Join Date: Jun 2003
Location: Glasgow, Scotland
Posts: 188
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally posted by Shane
haha..wellll I won.
they dont call him the Super Moderator.NET guy for nothing!
Reply With Quote
  #10 (permalink)  
Old 08-27-03, 04:03 PM
MadDog MadDog is offline
Code Master
 
Join Date: Aug 2003
Posts: 935
Thanks: 0
Thanked 0 Times in 0 Posts
He calls himself that

You can change it in your profile
__________________
Drew Gauderman
ASP - MSSQL Coder / Buisness Owner / Coder for Hire!
MSN-ICQ-AIM-YIM in Profile

http://www.iportalx.net an easy ASP portal system.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ADODB.Connection error '800a0bb9' - HELP! seala ASP 1 03-09-05 05:37 AM
error when creating database tables with php script spiroth10 PHP 4 01-06-04 03:59 PM
getting -2147217900 error while inserting and updating skchakri ASP 3 09-20-03 10:34 AM
Funny error returned. Mister B. ASP.NET 3 08-24-03 06:39 PM
An error in searching function obie Hot Scripts Forum Questions, Suggestions and Feedback 0 06-12-03 10:23 AM


All times are GMT -5. The time now is 03:22 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.