Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Other Programming > VBScript
|
VBScript For questions and discussions related to VBScript.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VBScript 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
  #1 (permalink)  
Old November 19th, 2004, 05:20 PM
Registered User
 
Join Date: Nov 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default need help new to this site

Value is not getting inserted into clearance ( from strAccess to strClearance) Help please

Where is my mistake
Thank you
Attach Code

<%

Dim strAccess
    strClearance = client
    If Request.Form("Access") = "realestatesales" Then
    strAccess = realtor
     End If

set cmdInsert = Server.CreateObject("ADODB.Command")
cmdInsert.ActiveConnection = MM_RFSOnline_STRING
cmdInsert.CommandText = "INSERT INTO personaldata (username, password, clearance, firstname, lastname, spousename, spouselastname, phone, cell, address, city, state, zip, mailaddress, mailcity, mailstate, mailzip) VALUES ('" + Replace(cmdInsert__strEmailAddress, "'", "''") + "', '" + Replace(cmdInsert__strPassword, "'", "''") + "', '" + Replace(cmdInsert__strClearance, "'", "''") + "', '" + Replace(cmdInsert__strFirstName, "'", "''") + "', '" + Replace(cmdInsert__strLastName, "'", "''") + "','" + Replace(cmdInsert__strSpouseName, "'", "''") + "','" + Replace(cmdInsert__strSpouseLastName, "'", "''") + "','" + Replace(cmdInsert__strPhone, "'", "''") + "', '" + Replace(cmdInsert__strCell, "'", "''") + "', '" + Replace(cmdInsert__strAddress, "'", "''") + "', '" + Replace(cmdInsert__strCity, "'", "''") + "', '" + Replace(cmdInsert__strState, "'", "''") + "', '" + Replace(cmdInsert__strZIP, "'", "''") + "', ' " + Replace(cmdInsert__strMailAddress, "'", "''") + "', '" + Replace(cmdInsert__strMailCity, "'", "''") + "',' " + Replace(cmdInsert__strMailState, "'", "''") + "', '" + Replace(cmdInsert__strMailZIP, "'", "''") + "') "
cmdInsert.CommandType = 1
cmdInsert.CommandTimeout = 0
cmdInsert.Prepared = true
cmdInsert.Execute()
%>


Reply With Quote
  #2 (permalink)  
Old November 22nd, 2004, 06:52 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
quote: Value is not getting inserted into clearance
What else do you observe, when you say value is not getting inserted? Any sort of error you see? Can you do a response.write of insert statement and post here?
Code:
...
...
cmdInsert.Prepared = true
Response.write cmdInsert.CommandText 
Response.end
cmdInsert.Execute()
Cheers!

_________________________
- Vijay G
Strive for Perfection
Reply With Quote
  #3 (permalink)  
Old December 17th, 2004, 04:18 PM
Registered User
 
Join Date: Dec 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:
I'm a bit confused by the question you are asking and the code you posted.

The first 5 lines (through the End If) seem to have nothing to do with the rest of the code.

To respond to your comment on 'Value is not getting inserted into clearance (from strAccess to strClearance):

strClearance = strAccess <- this will make the value of strClearance the same as what is contained in strAccess.
Reply With Quote
  #4 (permalink)  
Old December 20th, 2004, 09:10 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Try this:

'======================================
Dim strAccess
Dim strClearance

strClearance = "client"

    If Request.Form("Access") = "realestatesales" Then
       strAccess = "realtor"
    End If
'======================================

You can't pass strings unless they are in quotes.
Where are you getting the "Request.Form("Access") from?


mmcdonal
Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
Site Down pinch BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 25 October 15th, 2007 03:15 AM
Publish Web Site & Copy Web Site angshujit ASP.NET 2.0 Basics 1 June 15th, 2007 09:21 AM
site help LiquidMayCry Forum and Wrox.com Feedback 1 August 2nd, 2005 03:52 AM
how do i change the site icon on a geocitiies site uprocker2 HTML Code Clinic 2 March 4th, 2005 07:20 AM
New Site etc.. Ammiel Forum and Wrox.com Feedback 0 June 21st, 2003 10:40 PM





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