Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > Adobe Web Programming > Dreamweaver (all versions)
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Dreamweaver (all versions) section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 5th, 2006, 06:52 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

That's consistent with the previous SQL statement you posted.

The variables Keyword, CategoryTable and Location don't have a value. Where do you assign these variables a value?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
 
Old June 5th, 2006, 07:16 AM
Authorized User
 
Join Date: Aug 2005
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I see now, added Part 1 just above the code and its inserting 3 out of 4. The 'user' is left blank in the database.
Part 1
<%
Keyword = request.form("Keyword")
CategoryTable = request.form("CategoryTable")
Location = request.form("Location")
User = Session("MM_UserName")
%>
Part 2
<%
set conn = Server.CreateObject("ADODB.Connection")
conn.Open MM_connSeek_STRING
SQL = "INSERT INTO tblSearchResults ([result], [category], [location], [user]) " _
& " VALUES('" & Keyword & "', '" & CategoryTable & "', '" & Location & "', '" & MM_UserName & "')"
conn.Execute SQL
%>

 
Old June 5th, 2006, 07:24 AM
Authorized User
 
Join Date: Aug 2005
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Heya, changed the value from this...

& " VALUES('" & Keyword & "', '" & CategoryTable & "', '" & Location & "', '" & MM_UserName & "')"

To this...

& " VALUES('" & Keyword & "', '" & CategoryTable & "', '" & Location & "', '" & User & "')"

And it worked fine.

Again.

Thanks Imar.
 
Old June 5th, 2006, 07:29 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Do you have Option Explicit on top of your ASP page?

If not, it's recommended to do so. Using Option Explicit forces you to Dim all your variables. With that option turned on, the script parser would have seen that MM_UserName was an undeclared variable, and would have thrown an error.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004





Similar Threads
Thread Thread Starter Forum Replies Last Post
Combine two queries snufse SQL Server 2005 6 June 24th, 2008 09:42 PM
combine the nodes pravind XSLT 3 April 23rd, 2007 01:11 PM
How to combine two value-of selects? myhtpc XSLT 2 February 14th, 2006 06:20 AM
Best Way To Combine Reports ? jkirst BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 May 16th, 2005 09:56 AM
combine 2 queries collie SQL Server 2000 2 November 29th, 2004 03:09 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.