Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Adding data to different cats. in a DB
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Adding data to different cats. in a DB

 Post Reply Post Reply Page  <12
Author
worldwide1504 View Drop Down
Groupie
Groupie
Avatar

Joined: 15 July 2002
Location: United States
Status: Offline
Points: 55
Post Options Post Options   Thanks (0) Thanks(0)   Quote worldwide1504 Quote  Post ReplyReply Direct Link To This Post Posted: 13 December 2003 at 8:25am
Sweet it worked. Thanks a lot!
Back to Top
worldwide1504 View Drop Down
Groupie
Groupie
Avatar

Joined: 15 July 2002
Location: United States
Status: Offline
Points: 55
Post Options Post Options   Thanks (0) Thanks(0)   Quote worldwide1504 Quote  Post ReplyReply Direct Link To This Post Posted: 13 December 2003 at 9:58am

 

Ok I have another question. Now I added the drop down box to the delete page.

So when i select a category, it takes me to the correct page to delete an icon. But when I click on one it takes me to an error page that says "Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another. "

Here is the code for that page:


<% 'Dimension variables
Dim adoCon            'Holds the Database Connection Object
Dim rsDeleteIcon   'Holds the recordset for the record to be deleted
Dim strSQL             'Holds the SQL query to query the database
Dim lngRecordNo     'Holds the record number to be deleted 
Dim lngCatName

'Read in the record number to be deleted
lngRecordNo = CLng(Request.QueryString("ID"))

'Create an ADO connection object
Set adoCon = Server.CreateObject("ADODB.Connection")

'Set an active connection to the Connection object using a DSN-less connection
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("../db/Icons.mdb")

'Create an ADO recordset object
Set rsDeleteIcon = Server.CreateObject("ADODB.Recordset")

category = Request("category")

select case category
 case "GAME"
  strSQL = "SELECT game.* FROM game WHERE ID=" & lngRecordNo
 case "MUSIC"
  strSQL = "SELECT music.* FROM music WHERE ID=" & lngRecordNo
 case "OTHER"
  strSQL = "SELECT other.* FROM other WHERE ID=" & lngRecordNo
 case "TVMOVIES"
  strSQL = "SELECT tvmovie.* FROM tvmovie WHERE ID=" & lngRecordNo
end select

'Set the lock type so that the record is locked by ADO when it is deleted
rsDeleteIcon.LockType = 3

'Open the recordset with the SQL query
rsDeleteIcon.Open strSQL, adoCon

'Delete the record from the database
rsDeleteIcon.Delete

'Reset server objects
rsDeleteIcon.Close
Set rsDeleteIcon = Nothing
Set adoCon = Nothing

'Return to the delete select page in case another record needs deleting
Response.Redirect "delete_pick_cat_form.asp"
%>

And the error is apparently on this line:


'Open the recordset with the SQL query
rsDeleteIcon.Open strSQL, adoCon



Edited by worldwide1504
Back to Top
TYSON View Drop Down
Groupie
Groupie


Joined: 18 August 2002
Location: Australia
Status: Offline
Points: 142
Post Options Post Options   Thanks (0) Thanks(0)   Quote TYSON Quote  Post ReplyReply Direct Link To This Post Posted: 13 December 2003 at 7:44pm

Are you passing the category along with the ID in the querystring?

IE : Delete.asp?ID=1&category=MUSIC

Back to Top
worldwide1504 View Drop Down
Groupie
Groupie
Avatar

Joined: 15 July 2002
Location: United States
Status: Offline
Points: 55
Post Options Post Options   Thanks (0) Thanks(0)   Quote worldwide1504 Quote  Post ReplyReply Direct Link To This Post Posted: 14 December 2003 at 7:25am

No, but Ill try that later.

I gotta go to work now.

Back to Top
worldwide1504 View Drop Down
Groupie
Groupie
Avatar

Joined: 15 July 2002
Location: United States
Status: Offline
Points: 55
Post Options Post Options   Thanks (0) Thanks(0)   Quote worldwide1504 Quote  Post ReplyReply Direct Link To This Post Posted: 14 December 2003 at 3:29pm

Ok, now I get this error:

 Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2.

On this line:


'Open the recordset with the SQL query
rsDeleteIcon.Open strSQL, adoCon

Back to Top
aalavar View Drop Down
Groupie
Groupie


Joined: 08 December 2003
Status: Offline
Points: 46
Post Options Post Options   Thanks (0) Thanks(0)   Quote aalavar Quote  Post ReplyReply Direct Link To This Post Posted: 15 December 2003 at 6:36am
On the delete page, what did you name the drop down box?  What does your whole querystring look like?  i.e. copy and paste everything in the url after the ?, that may help to find it.
Back to Top
 Post Reply Post Reply Page  <12

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.