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 > "Arguments are of the wrong type, are out of acceptable range...etc"

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-16-04, 01:40
kaiousama kaiousama is offline
Registered User
 
Join Date: Feb 2004
Posts: 2
"Arguments are of the wrong type, are out of acceptable range...etc"

I'm relatively new to ASP work, I've been teaching myself from scratch for about 2 days now, and I've been able to do a lot of work with databses because of it, but now I am working on a web-interface to add in the data through forms instead of offline then uploading a very large DB to my server every few days.

However, when I submit my data, every time this error occurs:

"ADODB.Recordset error '800a0bb9'

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

/addrelease.asp, line 41"
------
These are lines 39-41:

Line 39: strSQLQuery = "INSERT INTO games (strName, strLink, intSize, strGenre) VALUES (" & strGameName & ", " & strGameLink & ", " & intGameSize & ", " & strGameGenre & ")"

Line 40: Set rs = Server.CreateObject("ADODB.Recordset")

Line 41: rs.Open strSQLQuery, conn, 3, 3



I was basically copying another script I had found, and I thought all would be well. I converted intGameSize to a long int earlier in the code, so it fits the format used in the database. For a while I thought it might be because I sent "intGameSize" with ' at the beginning and end, but that was obviously wrong (used to working with C code, so it was worth a shot).



Can anybody give me a suggestion to what I'm doing wrong? I've tried having the code spit out exactly what is being sent, and this is the exact value of strSQLQuery:

INSERT INTO games (strName, strLink, intSize, strGenre) VALUES (Name of Game, edk2://, 5000, Arcade Classic)



- Hope somebody can help me out,
Kaiousama
Reply With Quote
  #2 (permalink)  
Old 02-16-04, 03:12
kaeldowdy kaeldowdy is offline
Member
 
Join Date: Apr 2003
Location: Evansville, Indiana
Posts: 75
Re: "Arguments are of the wrong type, are out of acceptable range...etc"

Okay...looks like you are just wanting to insert a record into a database, and not return a recordset.

If you want to insert a record, do something like this:

strSQL = "INSERT query"

cn.Open
cn.Execute strSQL ' here's the key line of code!
cn.Close
Set cn = Nothing

However, if you want to return a recordset, you would do this:

strSQL = "SELECT query"

cn.Open
Set rs = cn.Execute strSQL
' use the recordset object named rs to loop and do something...
rs.close
cn.close
Set rs = Nothing
Set cn = Nothing

HTH!

Kael MCSD, A+
Reply With Quote
  #3 (permalink)  
Old 02-16-04, 08:13
Bullschmidt Bullschmidt is offline
Guru
 
Join Date: Jun 2003
Location: USA
Posts: 1,032
Or for a "quick and dirty" generic ASP open source solution to putting databases on the Web that just requires setting up a configuration page for each table or query and uploading the database to the Web as long as there is an autonumber field in each table (and you'll probably also separately want to create login capabilities), perhaps try something like this:
GenericDB by Eli Robillard
http://www.genericdb.com and then click on the Tips link to see an example
__________________
J. Paul Schmidt, Freelance Web and Database Developer
www.Bullschmidt.com
Access Database Sample, Web Database Sample, ASP Design Tips
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