Go Back   CodingForums.com > :: Server side development > ASP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-26-2012, 03:13 PM   PM User | #1
JonRTW
New to the CF scene

 
Join Date: Sep 2012
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
JonRTW is an unknown quantity at this point
Arguments are of the wrong type, are out of acceptable range, or are in conflict with

Hi All,


I get the error :
Code:
ADODB.Recordset error '800a0bb9' 

Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another. 

/shipslip.asp, line 15
when executing a script I am running.

The file is as follows:
Code:
shipslip.asp

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/packslip.asp" -->
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If (Request.QueryString("id") <> "") Then 
  Recordset1__MMColParam = Request.QueryString("id")
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_packslip_STRING
Recordset1.Source = "SELECT * FROM orders WHERE orderid = " + Replace(Recordset1__MMColParam, "'", "''") + ""
'Recordset1.Source = "SELECT * FROM orders WHERE orderid = '2'"
Recordset1.CursorType = 2
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()

Recordset1_numRows = 0
%>
The included file, Connections\packslip.asp is as follows:

Code:
<%
' FileName="Connection_odbc_conn_dsn.htm"
' Type="ADO" 
' DesigntimeType="ADO"
' HTTP="false"
' Catalog=""
' Schema=""

Dim MM_packslip_STRING
MM_invoice_STRING = "DRIVER={MySQL}; SERVER=#####; DATABASE=temple; User=#####;PASSWORD=#####; OPTION=3;"
%>

Can anybody offer any assistance with this error?
Thanks in advance,

Jon
JonRTW is offline   Reply With Quote
Old 09-26-2012, 09:40 PM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,244
Thanks: 59
Thanked 3,998 Times in 3,967 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Ummm...

Code:
MM_invoice_STRING = "DRIVER={MySQL}; SERVER=#####; DATA...."
but then
Code:
Recordset1.ActiveConnection = MM_packslip_STRING
If you care, that code generated by Dumb and Worthless (a.k.a. the seriously misnamed "DreamWeaver") is about 5 times more complex than needed.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Users who have thanked Old Pedant for this post:
JonRTW (09-27-2012)
Old 09-26-2012, 09:45 PM   PM User | #3
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,244
Thanks: 59
Thanked 3,998 Times in 3,967 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Oh, heck. I can't stand it.
Code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "DRIVER={MySQL}; SERVER=#####; DATABASE=temple; User=#####;PASSWORD=#####; OPTION=3;"

id = 0
On Error Resume Next
   id = CLNG( Request("id") )
On Error GoTo 0

SQL = "SELECT * FROM orders WHERE orderid = " & id
Set Recordset1 = conn.Execute( SQL )
If Recordset1.EOF Then
     conn.Close
     Response.Write "Invalid id passed from previous page."
     Response.End
End If

... now work with the recordset ...
%>
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Old 09-27-2012, 04:07 PM   PM User | #4
JonRTW
New to the CF scene

 
Join Date: Sep 2012
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
JonRTW is an unknown quantity at this point
Hi,

Many thanks for the reply. I must confess ASP isn't something I am too familiar with. I am more of a PHP person myself, but got asked to look at this problem by a friend. I'll try the change as you mentioned.


Edit:
Fixed it! Many many thanks

Last edited by JonRTW; 09-27-2012 at 04:09 PM.. Reason: Fixed!!
JonRTW is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 09:13 PM.


Advertisement
Log in to turn off these ads.