SQL Insert help

This is a discussion on "SQL Insert help" within the Classic ASP section. This forum, and the thread "SQL Insert help are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jan 4th, 2006, 15:33
Junior Member
Join Date: Dec 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
SQL Insert help

Hey guys I have this on a page and it fails to retreive the magazineID parsed by the previous page?
HTML: Select all
strSQL = "UPDATE tbl_ealert SET LIST_CIRC = 'No', LIST_ADV = 'No', DIGITALISSUE = 'incomplete', EDITORTEXT = 'No' WHERE MAGAZINEID = <%= Request.QueryString("magazineid") %>;"
I get this error?
Quote:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
Thanks if you can help
Steve
Reply With Quote

  #2 (permalink)  
Old Jan 4th, 2006, 16:34
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
Re: SQL Insert help

before you execute your SQL, try using response.write strSQL to print it to the screen..... you should then see that you are likely not receiving the magazineid for whatever reason.... spelling error?
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
Reply With Quote
  #3 (permalink)  
Old Jan 4th, 2006, 16:36
Junior Member
Join Date: Dec 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Re: SQL Insert help

I have tired that and still no luck. It brings through the magazineid just fine but for some reason the sql statement can't deal with it?
Reply With Quote
  #4 (permalink)  
Old Jan 4th, 2006, 16:37
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
Re: SQL Insert help

Can you post the SQL statement as returned by response.write?
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
Reply With Quote
  #5 (permalink)  
Old Jan 4th, 2006, 16:40
Junior Member
Join Date: Dec 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Re: SQL Insert help

Sorry what do you mean?
Reply With Quote
  #6 (permalink)  
Old Jan 4th, 2006, 16:42
Junior Member
Join Date: Dec 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Re: SQL Insert help

Sorry this is my page:

Quote:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/ealert.asp" -->
<%
Dim rs_ealert__MMColParam
rs_ealert__MMColParam = "1"
If (Request.QueryString("MAGAZINEID") <> "") Then
rs_ealert__MMColParam = Request.QueryString("MAGAZINEID")
End If
%>
<%
Dim rs_ealert
Dim rs_ealert_numRows

Set rs_ealert = Server.CreateObject("ADODB.Recordset")
rs_ealert.ActiveConnection = MM_ealert_STRING
rs_ealert.Source = "SELECT * FROM tbl_ealert WHERE MAGAZINEID = " + Replace(rs_ealert__MMColParam, "'", "''") + ""
rs_ealert.CursorType = 0
rs_ealert.CursorLocation = 2
rs_ealert.LockType = 1
rs_ealert.Open()

rs_ealert_numRows = 0
%>


<%
dim strSQL
dim oconn
set oconn = Server.CreateObject("ADODB.Connection")
oconn.connectionstring="Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\Inetpub\databases\ealert.mdb"
oConn.Open

%>
<%= response.write ("sadsaa") %>

<%
strSQL = "UPDATE tbl_ealert SET LIST_CIRC = 'No', LIST_ADV = 'No', DIGITALISSUE = 'incomplete', EDITORTEXT = 'No' WHERE MAGAZINEID = <%= Request.QueryString("magazineid") %>;"




'now execute the queries
oconn.execute strSQL
'conn.execute strSQL2

response.write("All done!")

oconn.close
set conn = nothing
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>

</body>
</html>
<%
rs_ealert.Close()
Set rs_ealert = Nothing
%>
Reply With Quote
  #7 (permalink)  
Old Jan 5th, 2006, 09:54
Junior Member
Join Date: Dec 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Re: SQL Insert help

Anyone?
Reply With Quote
  #8 (permalink)  
Old Jan 5th, 2006, 12:04
Highly Reputable Member
Join Date: Jul 2003
Location: Ipswich, UK
Posts: 690
Thanks: 0
Thanked 0 Times in 0 Posts
Re: SQL Insert help

do a Response.Write strSQL and post the outcome here.
Reply With Quote
  #9 (permalink)  
Old Jan 5th, 2006, 13:16
Junior Member
Join Date: Dec 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Re: SQL Insert help

Where abouts though?
Reply With Quote
  #10 (permalink)  
Old Jan 5th, 2006, 20:56
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
Re: SQL Insert help

before this line :-
oconn.execute strSQL

add the following:
Code: Select all
Response.Write strSQL : response.end
Run the code and paste everything shown in your browser window!

Thanks.
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
Reply With Quote
  #11 (permalink)  
Old Jan 9th, 2006, 10:58
Junior Member
Join Date: Dec 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Re: SQL Insert help

Quote:
The page cannot be displayed

There is a problem with the page you are trying to reach and it cannot be displayed. Please try the following:
  • Click the Refresh button, or try again later.
  • Open the localhost home page, and then look for links to the information you want.
HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services


Technical Information (for support personnel)
  • Error Type:
    Microsoft VBScript compilation (0x800A0401)
    Expected end of statement
    /ealert/testing_queries.asp, line 37, column 158
    strSQL = "UPDATE tbl_ealert SET LIST_CIRC = 'No', LIST_ADV = 'No', DIGITALISSUE = 'incomplete', EDITORTEXT = 'No' WHERE MAGAZINEID = <%= Request.QueryString("magazineid")
    -------------------------------------------------------------------------------------------------------------------------------------------------------------^
  • Browser Type:
    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.40607)
  • Page:
    GET /ealert/testing_queries.asp
  • Time:
    09 January 2006, 11:56:50
  • More information:
    Microsoft Support
Does this help?
Reply With Quote
  #12 (permalink)  
Old Jan 9th, 2006, 10:59
Junior Member
Join Date: Dec 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Re: SQL Insert help

Quote:
The page cannot be displayed

There is a problem with the page you are trying to reach and it cannot be displayed. Please try the following:
  • Click the Refresh button, or try again later.
  • Open the localhost home page, and then look for links to the information you want.
HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services


Technical Information (for support personnel)
  • Error Type:
    Microsoft VBScript compilation (0x800A0401)
    Expected end of statement
    /ealert/testing_queries.asp, line 37, column 158
    strSQL = "UPDATE tbl_ealert SET LIST_CIRC = 'No', LIST_ADV = 'No', DIGITALISSUE = 'incomplete', EDITORTEXT = 'No' WHERE MAGAZINEID = <%= Request.QueryString("magazineid")
    -------------------------------------------------------------------------------------------------------------------------------------------------------------^
  • Browser Type:
    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.40607)
  • Page:
    GET /ealert/testing_queries.asp
  • Time:
    09 January 2006, 11:56:50
  • More information:
    Microsoft Support
.
Reply With Quote
  #13 (permalink)  
Old Jan 9th, 2006, 13:16
Junior Member
Join Date: Dec 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Re: SQL Insert help

The page cannot be displayed

There is a problem with the page you are trying to reach and it cannot be displayed. Please try the following:
  • Click the Refresh button, or try again later.
  • Open the localhost home page, and then look for links to the information you want.
HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services


Technical Information (for support personnel)
  • Error Type:
    Microsoft VBScript compilation (0x800A0401)
    Expected end of statement
    /ealert/testing_queries.asp, line 37, column 158
    strSQL = "UPDATE tbl_ealert SET LIST_CIRC = 'No', LIST_ADV = 'No', DIGITALISSUE = 'incomplete', EDITORTEXT = 'No' WHERE MAGAZINEID = <%= Request.QueryString("magazineid")
    -------------------------------------------------------------------------------------------------------------------------------------------------------------^
  • Browser Type:
    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.40607)
  • Page:
    GET /ealert/testing_queries.asp
  • Time:
    09 January 2006, 14:16:02
  • More information:
    Microsoft Support
Reply With Quote
  #14 (permalink)  
Old Jan 12th, 2006, 08:38
Junior Member
Join Date: Dec 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Re: SQL Insert help

anyone?
Reply With Quote
Reply

Tags
sql, insert, help

Thread Tools

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert into db problem benbigun PHP Forum 7 Nov 15th, 2005 01:51
insert record accessman Databases 1 Oct 15th, 2005 01:12
how do i insert a preloader ? tigas langaw Flash & Multimedia Forum 15 Jun 13th, 2005 14:03
Insert Record redkyna Classic ASP 11 Aug 25th, 2004 22:46


All times are GMT. The time now is 06:23.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43