Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > Server Side Programming > ASP and ASP.NET
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 03-08-2006, 02:20 PM
  #1
gillweb
Swordman (Level 9)
 
gillweb's Avatar
 
Join Date: May 2004
Posts: 87
iTrader: (0)
gillweb is on a distinguished road
Uknown Error Updating Row?

Heres the code i have
PHP Code:
<%

Done request.querystring("done")
id request.querystring("id")

Set Rs Server.CreateObject("ADODB.RecordSet")
    
sSQL =     "SELECT * FROM fastpay where id=" request.querystring("id")

          
Rs.Open sSQLsDSNadOpenKeySetadLockPessimisticadCmdText

If NOT Rs.EOF Then
        
Do While NOT Rs.EOF

Rs
("Done")=done
Rs
.Update


            Rs
.MoveNext
            iIndex 
iIndex 1
            
If iIndex 3 Then
                iIndex 
0
            End 
If
        
Loop
    End 
If    
Response.Redirect("fastpay_print.asp")

%> 
but I am getting an error on line 9 saying
PHP Code:
Error Type:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong typeare out of acceptable range, or are in conflict with one another
Any idea on what I am doing wrong here? It seems like the Rs.Open sSQL line that is the problem.
gillweb is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 03-08-2006, 03:30 PM
  #2
afterburn
Can't say much here
 
afterburn's Avatar
 
Join Date: May 2004
Posts: 2,851
iTrader: (0)
afterburn will become famous soon enough
give us the data type that the db is expecting and the full error ... and point out the line that the error is occuring for us to help.
__________________
ASP.net nice bits
Code Smith rocking tool for Code Generation in any language (Written in .net)
Red Gate SQL tools for DBA
Blog Personal blog
.afterburn
afterburn is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 03-08-2006, 03:41 PM
  #3
gillweb
Swordman (Level 9)
 
gillweb's Avatar
 
Join Date: May 2004
Posts: 87
iTrader: (0)
gillweb is on a distinguished road
Got it! For got to include my "adovbs.inc" file :-) Thansk for the help, didn't think of that until you asked for the DB info...
gillweb is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 03-08-2006, 04:06 PM
  #4
afterburn
Can't say much here
 
afterburn's Avatar
 
Join Date: May 2004
Posts: 2,851
iTrader: (0)
afterburn will become famous soon enough
including the adovb.inc file is a bad idea you should load the reference in the global.asa file instead. loaded once . variables are available using intelisence (VS InterDev, VS.net).

and thread safe. not parsed and compiled code..... no more reason to not.
__________________
ASP.net nice bits
Code Smith rocking tool for Code Generation in any language (Written in .net)
Red Gate SQL tools for DBA
Blog Personal blog
.afterburn
afterburn is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 03-08-2006, 04:09 PM
  #5
afterburn
Can't say much here
 
afterburn's Avatar
 
Join Date: May 2004
Posts: 2,851
iTrader: (0)
afterburn will become famous soon enough
i might want to explain there is a security breach in your code also.

Anyone with half a brain could drop tables by sending URL encoding parameters with

"0--" & vbNewLine & Drop database master
__________________
ASP.net nice bits
Code Smith rocking tool for Code Generation in any language (Written in .net)
Red Gate SQL tools for DBA
Blog Personal blog
.afterburn
afterburn is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 03-15-2006, 11:13 PM
  #6
gillweb
Swordman (Level 9)
 
gillweb's Avatar
 
Join Date: May 2004
Posts: 87
iTrader: (0)
gillweb is on a distinguished road
I'm not sure I follow you. Are you saying that someone could send in the querystring ""0--" & vbNewLine & Drop database master" and that would drop my entire database? How would/does global.asa stop this?
gillweb is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 03-16-2006, 09:38 AM
  #7
afterburn
Can't say much here
 
afterburn's Avatar
 
Join Date: May 2004
Posts: 2,851
iTrader: (0)
afterburn will become famous soon enough
That was a side not. The first part solves the issue of including the file in every asp page requiring the server to parse it everytime a page is requested.

The other note was a security issue. Yes if i sent the value in the query string I can drop the entire db and there is not much you can do if your security is not setup correctly.
__________________
ASP.net nice bits
Code Smith rocking tool for Code Generation in any language (Written in .net)
Red Gate SQL tools for DBA
Blog Personal blog
.afterburn
afterburn is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote

Reply
KEEP TABS
SPONSORS
 
Boxedart



 
 


 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
  
 
 
 



 
  POSTING RULES
 
 
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 11:35 PM.

   

Mascot team created by Drawshop.com

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.