Solved

VBScript and ASP - Please help!!!

Posted on 2001-06-02
24
495 Views
Last Modified: 2008-02-01
I started a project using Data Access Pages which is a new thing in Access 2000.  It is using VBScript as its script.  However, when I thought I had finished the project the user wanted the information broken up into two tables a bids and a merchandise tables.  Well Data Access Pages doesn't like this so I converted it to ASP.  I can connect to the tables and insert information.  My problem comes to when I try to take the value from a text box that was written in VB Script and call it in an ASP Script.  I have tried the VB Script that I have used in other places (varLastName = txtLastName.value) that does not work.  I have also tried the (varLastName = request.form("txtLastname")to no avail.  Any suggestions?  I can send the whole script if anyone cares to look through it.  It really is not all that bad - I just didn't want to post it all.

Here is the code I am trying to use.

<SCRIPT event=onclick for=cmdSubmitBid language=vbscript>
<!--

enterbid
dim vbtxtlastname
dim varItemName
vbtxtlastname = txtlastname.value
varitemname = vbtxtlastname

          <%
          'Sub enterBidsTable
          'connect to the bids table
               dim objconn
               

          'Create and open the database object
               Set objConn=Server.CreateObject("ADODB.Recordset")
          '     objconn.open, "Bids", "dsn=unitedway",adopendynamic,adlockpessimistic
         
          'varitemname = "Boy Wonder"
          'varitemname = vbtxtlastname
          'varItemName = txtLastName
          'varItemName = txtLastName.value
          'varItemName = Request.form("txtLastName")
          sqltext = "insert into Bids (item, Type_of_Item, Item_Name, Item_Description, Current_Bid, ID, First_Name, Last_Name, Middle_Initial, Ext) values ('6969', 'UWTEST', '" & varItemName & "', 'Big comfy leather couch', '100', '22813', 'John', '844', 'B', '1234' );"
          'Response.write varItemName

          objconn.open sqltext, "dsn=Unitedway"
          set objconn = nothing
          'objconn.close
          'end sub
          %>

msgbox vbtxtlastname

-->
</SCRIPT>

0
Comment
Question by:flfmmqp
  • 8
  • 8
  • 6
  • +2
24 Comments
 
LVL 8

Expert Comment

by:drittich
Comment Utility
If you un-comment this line:

'varItemName = Request.form("txtLastName")

it should work, assuming you have an input box called txtLastName in your form you are submitting.  Post all of the code.
0
 

Author Comment

by:flfmmqp
Comment Utility
drittich:

All the ones with a commented line have been tried.  I try to keep a record of the things i have already tried.  This is driving me crazy.  Here is all of the code.  Thanks for trying to help.  I have tried so many things that I am running out of ideas.




<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>2001UW Bidders Page</TITLE><LINK
href="./2001UW_files/filelist.xml" rel=File-List type=text/xml>
<META content=FrontPage.Editor.Document name=ProgId>
<META name=VBSForEventHandlers VALUE="TRUE">
<META content="text/html; charset=windows-1252" http-equiv=Content-Type>
<STYLE id=MSODAPDEFAULTS type=text/css rel="stylesheet"></STYLE>

<OBJECT classid=CLSID:0002E530-0000-0000-C000-000000000046
codeBase=file:I:\msowc.cab id=MSODSC><PARAM NAME="XMLData" VALUE="<xml xmlns:a=&quot;urn:schemas-microsoft-com:office:access&quot;>&#13;&#10; <a:DataSourceControl>&#13;&#10;  <a:OWCVersion>9.0.0.3821</a:OWCVersion>&#13;&#10;  <a:ConnectionString>Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=G:\United Way 2001\UWSA.mdb;Jet OLEDB:System database=&amp;quot;&amp;quot;;Jet OLEDB:Database Password=&amp;quot;&amp;quot;</a:ConnectionString>&#13;&#10;  <a:MaxRecords>10000</a:MaxRecords>&#13;&#10;  <a:GridX>24</a:GridX>&#13;&#10;  <a:GridY>24</a:GridY>&#13;&#10;  <a:ElementExtension>&#13;&#10;   <a:ElementID>SilentAuctionNavigation</a:ElementID>&#13;&#10;   <a:ConsumesRecordset/>&#13;&#10;  </a:ElementExtension>&#13;&#10;  <a:ElementExtension>&#13;&#10;   <a:ElementID>txtItem</a:ElementID>&#13;&#10;   <a:ControlSource>Item #</a:ControlSource>&#13;&#10;   <a:ChildLabel>Item#_Label</a:ChildLabel>&#13;&#10;  </a:ElementExtension>&#13;&#10;  <a:ElementExtension>&#13;&#10;   <a:ElementID>txtTypeofItem</a:ElementID>&#13;&#10;   <a:ControlSource>Type of Item</a:ControlSource>&#13;&#10;   <a:ChildLabel>TypeofItem_Label</a:ChildLabel>&#13;&#10;  </a:ElementExtension>&#13;&#10;  <a:ElementExtension>&#13;&#10;   <a:ElementID>txtItemName</a:ElementID>&#13;&#10;   <a:ControlSource>Item Name</a:ControlSource>&#13;&#10;   <a:ChildLabel>ItemName_Label</a:ChildLabel>&#13;&#10;  </a:ElementExtension>&#13;&#10;  <a:ElementExtension>&#13;&#10;   <a:ElementID>txtItemDescription</a:ElementID>&#13;&#10;   <a:ControlSource>Item Description</a:ControlSource>&#13;&#10;   <a:ChildLabel>ItemDescription_Label</a:ChildLabel>&#13;&#10;  </a:ElementExtension>&#13;&#10;  <a:ElementExtension>&#13;&#10;   <a:ElementID>txtApproximateValue</a:ElementID>&#13;&#10;   <a:ControlSource>Approximate Value</a:ControlSource>&#13;&#10;   <a:ChildLabel>ApproximateValue_Label</a:ChildLabel>&#13;&#10;  </a:ElementExtension>&#13;&#10;  <a:ElementExtension>&#13;&#10;   <a:ElementID>txtYourbid</a:ElementID>&#13;&#10;   <a:ChildLabel>CurrentBid1_Label</a:ChildLabel>&#13;&#10;  </a:ElementExtension>&#13;&#10;  <a:ElementExtension>&#13;&#10;   <a:ElementID>txtBidderID</a:ElementID>&#13;&#10;   <a:ChildLabel>Text1_Label</a:ChildLabel>&#13;&#10;  </a:ElementExtension>&#13;&#10;  <a:ElementExtension>&#13;&#10;   <a:ElementID>ItemName</a:ElementID>&#13;&#10;   <a:ControlSource>Item Name</a:ControlSource>&#13;&#10;   <a:ListRowSource>SilentAuction</a:ListRowSource>&#13;&#10;   <a:ListBoundField>Item Name</a:ListBoundField>&#13;&#10;   <a:ListDisplayField>Item Name</a:ListDisplayField>&#13;&#10;   <a:ChildLabel>ItemName_Label1</a:ChildLabel>&#13;&#10;  </a:ElementExtension>&#13;&#10;  <a:ElementExtension>&#13;&#10;   <a:ElementID>txtBidder</a:ElementID>&#13;&#10;   <a:ControlSource>Bidder</a:ControlSource>&#13;&#10;  </a:ElementExtension>&#13;&#10;  <a:ElementExtension>&#13;&#10;   <a:ElementID>txtFirstName</a:ElementID>&#13;&#10;   <a:ControlSource>First Name</a:ControlSource>&#13;&#10;  </a:ElementExtension>&#13;&#10;  <a:ElementExtension>&#13;&#10;   <a:ElementID>txtMiddleInitial</a:ElementID>&#13;&#10;   <a:ControlSource>Middle Initial</a:ControlSource>&#13;&#10;  </a:ElementExtension>&#13;&#10;  <a:ElementExtension>&#13;&#10;   <a:ElementID>txtLastName</a:ElementID>&#13;&#10;   <a:ControlSource>Last Name</a:ControlSource>&#13;&#10;  </a:ElementExtension>&#13;&#10;  <a:ElementExtension>&#13;&#10;   <a:ElementID>txtHoldFirstName</a:ElementID>&#13;&#10;   <a:ChildLabel>Text0_Label</a:ChildLabel>&#13;&#10;  </a:ElementExtension>&#13;&#10;  <a:ElementExtension>&#13;&#10;   <a:ElementID>txtHoldMI</a:ElementID>&#13;&#10;   <a:ChildLabel>txtHoldFirstName1_Label</a:ChildLabel>&#13;&#10;  </a:ElementExtension>&#13;&#10;  <a:ElementExtension>&#13;&#10;   <a:ElementID>txtHoldLastName</a:ElementID>&#13;&#10;   <a:ChildLabel>txtHoldMI2_Label</a:ChildLabel>&#13;&#10;  </a:ElementExtension>&#13;&#10;  <a:ElementExtension>&#13;&#10;   <a:ElementID>txtExt</a:ElementID>&#13;&#10;   <a:ControlSource>Ext</a:ControlSource>&#13;&#10;  </a:ElementExtension>&#13;&#10;  <a:ElementExtension>&#13;&#10;   <a:ElementID>txtholdext</a:ElementID>&#13;&#10;   <a:ChildLabel>txtHoldLastName3_Label</a:ChildLabel>&#13;&#10;  </a:ElementExtension>&#13;&#10;  <a:ElementExtension>&#13;&#10;   <a:ElementID>Firstname2</a:ElementID>&#13;&#10;   <a:ControlSource>2nd First name</a:ControlSource>&#13;&#10;  </a:ElementExtension>&#13;&#10;  <a:ElementExtension>&#13;&#10;   <a:ElementID>Lastname2</a:ElementID>&#13;&#10;   <a:ControlSource>2nd Last name</a:ControlSource>&#13;&#10;  </a:ElementExtension>&#13;&#10;  <a:ElementExtension>&#13;&#10;   <a:ElementID>MiddleInitial2</a:ElementID>&#13;&#10;   <a:ControlSource>2nd Middle Initial</a:ControlSource>&#13;&#10;  </a:ElementExtension>&#13;&#10;  <a:ElementExtension>&#13;&#10;   <a:ElementID>Ext2</a:ElementID>&#13;&#10;   <a:ControlSource>2nd Ext</a:ControlSource>&#13;&#10;  </a:ElementExtension>&#13;&#10;  <a:ElementExtension>&#13;&#10;   <a:ElementID>Firstname3</a:ElementID>&#13;&#10;   <a:ControlSource>3rd First name</a:ControlSource>&#13;&#10;  </a:ElementExtension>&#13;&#10;  <a:ElementExtension>&#13;&#10;   <a:ElementID>LastName3</a:ElementID>&#13;&#10;   <a:ControlSource>3rd Last Name</a:ControlSource>&#13;&#10;  </a:ElementExtension>&#13;&#10;  <a:ElementExtension>&#13;&#10;   <a:ElementID>MiddleInitial3</a:ElementID>&#13;&#10;   <a:ControlSource>3rd Middle Initial</a:ControlSource>&#13;&#10;  </a:ElementExtension>&#13;&#10;  <a:ElementExtension>&#13;&#10;   <a:ElementID>Ext3</a:ElementID>&#13;&#10;   <a:ControlSource>3rd Ext</a:ControlSource>&#13;&#10;  </a:ElementExtension>&#13;&#10;  <a:ElementExtension>&#13;&#10;   <a:ElementID>Bid2</a:ElementID>&#13;&#10;   <a:ControlSource>2nd Bid</a:ControlSource>&#13;&#10;  </a:ElementExtension>&#13;&#10;  <a:ElementExtension>&#13;&#10;   <a:ElementID>Bid3</a:ElementID>&#13;&#10;   <a:ControlSource>3rd Bid</a:ControlSource>&#13;&#10;  </a:ElementExtension>&#13;&#10;  <a:ElementExtension>&#13;&#10;   <a:ElementID>txtCurrentBid</a:ElementID>&#13;&#10;   <a:ControlSource>Current Bid</a:ControlSource>&#13;&#10;   <a:ChildLabel>CurrentBid_Label</a:ChildLabel>&#13;&#10;  </a:ElementExtension>&#13;&#10;  <a:ElementExtension>&#13;&#10;   <a:ElementID>ID</a:ElementID>&#13;&#10;   <a:ControlSource>ID</a:ControlSource>&#13;&#10;  </a:ElementExtension>&#13;&#10;  <a:ElementExtension>&#13;&#10;   <a:ElementID>ID2</a:ElementID>&#13;&#10;   <a:ControlSource>2nd ID</a:ControlSource>&#13;&#10;  </a:ElementExtension>&#13;&#10;  <a:ElementExtension>&#13;&#10;   <a:ElementID>ID3</a:ElementID>&#13;&#10;   <a:ControlSource>3rd ID</a:ControlSource>&#13;&#10;  </a:ElementExtension>&#13;&#10;  <a:ElementExtension>&#13;&#10;   <a:ElementID>txtholdid</a:ElementID>&#13;&#10;   <a:ChildLabel>Text1_Label1</a:ChildLabel>&#13;&#10;  </a:ElementExtension>&#13;&#10;  <a:GroupLevel>&#13;&#10;   <a:RecordSource>SilentAuction</a:RecordSource>&#13;&#10;   <a:DefaultSort></a:DefaultSort>&#13;&#10;   <a:HeaderElementId>HeaderSilentAuction</a:HeaderElementId>&#13;&#10;   <a:FooterElementId></a:FooterElementId>&#13;&#10;   <a:CaptionElementId></a:CaptionElementId>&#13;&#10;   <a:RecordNavigationElementId>NavigationSectionSilentAuction</a:RecordNavigationElementId>&#13;&#10;   <a:DataPageSize>1</a:DataPageSize>&#13;&#10;   <a:GroupFilterControl>itemName</a:GroupFilterControl>&#13;&#10;   <a:GroupFilterField>item name</a:GroupFilterField>&#13;&#10;  </a:GroupLevel>&#13;&#10;  <a:Datamodel version=&quot;0816&quot;>&#13;&#10;   <a:SchemaRowsource id=&quot;SilentAuction&quot; type=&quot;dscTable&quot;>&#13;&#10;    <a:SchemaField id=&quot;Item #&quot; datatype=&quot;3&quot; size=&quot;0&quot; iskey=&quot;1&quot;/>&#13;&#10;    <a:SchemaField id=&quot;Type of Item&quot; datatype=&quot;202&quot; size=&quot;50&quot;/>&#13;&#10;    <a:SchemaField id=&quot;Item Name&quot; datatype=&quot;202&quot; size=&quot;50&quot;/>&#13;&#10;    <a:SchemaField id=&quot;Item Description&quot; datatype=&quot;202&quot; size=&quot;255&quot;/>&#13;&#10;    <a:SchemaField id=&quot;Approximate Value&quot; datatype=&quot;202&quot; size=&quot;50&quot;/>&#13;&#10;    <a:SchemaField id=&quot;Current Bid&quot; datatype=&quot;3&quot; size=&quot;0&quot;/>&#13;&#10;    <a:SchemaField id=&quot;ID&quot; datatype=&quot;202&quot; size=&quot;50&quot;/>&#13;&#10;    <a:SchemaField id=&quot;First Name&quot; datatype=&quot;202&quot; size=&quot;50&quot;/>&#13;&#10;    <a:SchemaField id=&quot;Last Name&quot; datatype=&quot;202&quot; size=&quot;75&quot;/>&#13;&#10;    <a:SchemaField id=&quot;Middle Initial&quot; datatype=&quot;202&quot; size=&quot;1&quot;/>&#13;&#10;    <a:SchemaField id=&quot;Ext&quot; datatype=&quot;202&quot; size=&quot;50&quot;/>&#13;&#10;    <a:SchemaField id=&quot;2nd Bid&quot; datatype=&quot;202&quot; size=&quot;50&quot;/>&#13;&#10;    <a:SchemaField id=&quot;2nd ID&quot; datatype=&quot;202&quot; size=&quot;50&quot;/>&#13;&#10;    <a:SchemaField id=&quot;2nd First name&quot; datatype=&quot;202&quot; size=&quot;50&quot;/>&#13;&#10;    <a:SchemaField id=&quot;2nd Last name&quot; datatype=&quot;202&quot; size=&quot;50&quot;/>&#13;&#10;    <a:SchemaField id=&quot;2nd Middle Initial&quot; datatype=&quot;202&quot; size=&quot;1&quot;/>&#13;&#10;    <a:SchemaField id=&quot;2nd Ext&quot; datatype=&quot;202&quot; size=&quot;50&quot;/>&#13;&#10;    <a:SchemaField id=&quot;3rd Bid&quot; datatype=&quot;202&quot; size=&quot;50&quot;/>&#13;&#10;    <a:SchemaField id=&quot;3rd ID&quot; datatype=&quot;202&quot; size=&quot;50&quot;/>&#13;&#10;    <a:SchemaField id=&quot;3rd First name&quot; datatype=&quot;202&quot; size=&quot;50&quot;/>&#13;&#10;    <a:SchemaField id=&quot;3rd Last Name&quot; datatype=&quot;202&quot; size=&quot;50&quot;/>&#13;&#10;    <a:SchemaField id=&quot;3rd Middle Initial&quot; datatype=&quot;202&quot; size=&quot;1&quot;/>&#13;&#10;    <a:SchemaField id=&quot;3rd Ext&quot; datatype=&quot;202&quot; size=&quot;50&quot;/>&#13;&#10;    <a:SchemaField id=&quot;Bidder&quot; datatype=&quot;202&quot; size=&quot;50&quot;/>&#13;&#10;   </a:SchemaRowsource>&#13;&#10;   <a:RecordsetDef id=&quot;SilentAuction&quot;>&#13;&#10;    <a:PageField id=&quot;Item #&quot;/>&#13;&#10;    <a:PageField id=&quot;Type of Item&quot;/>&#13;&#10;    <a:PageField id=&quot;Item Name&quot;/>&#13;&#10;    <a:PageField id=&quot;Item Description&quot;/>&#13;&#10;    <a:PageField id=&quot;Approximate Value&quot;/>&#13;&#10;    <a:PageField id=&quot;Current Bid&quot;/>&#13;&#10;    <a:PageField id=&quot;ID&quot;/>&#13;&#10;    <a:PageField id=&quot;First Name&quot;/>&#13;&#10;    <a:PageField id=&quot;Last Name&quot;/>&#13;&#10;    <a:PageField id=&quot;Middle Initial&quot;/>&#13;&#10;    <a:PageField id=&quot;Ext&quot;/>&#13;&#10;    <a:PageField id=&quot;2nd Bid&quot;/>&#13;&#10;    <a:PageField id=&quot;2nd ID&quot;/>&#13;&#10;    <a:PageField id=&quot;2nd First name&quot;/>&#13;&#10;    <a:PageField id=&quot;2nd Last name&quot;/>&#13;&#10;    <a:PageField id=&quot;2nd Middle Initial&quot;/>&#13;&#10;    <a:PageField id=&quot;2nd Ext&quot;/>&#13;&#10;    <a:PageField id=&quot;3rd Bid&quot;/>&#13;&#10;    <a:PageField id=&quot;3rd ID&quot;/>&#13;&#10;    <a:PageField id=&quot;3rd First name&quot;/>&#13;&#10;    <a:PageField id=&quot;3rd Last Name&quot;/>&#13;&#10;    <a:PageField id=&quot;3rd Middle Initial&quot;/>&#13;&#10;    <a:PageField id=&quot;3rd Ext&quot;/>&#13;&#10;    <a:PageField id=&quot;Bidder&quot;/>&#13;&#10;   </a:RecordsetDef>&#13;&#10;  </a:Datamodel>&#13;&#10; </a:DataSourceControl>&#13;&#10;</xml>'&quot;"></OBJECT>
<META content="Microsoft FrontPage 4.0" name=GENERATOR><!--[if gte mso 9]><xml>
 <o:DocumentProperties>
  <o:Author>Preferred Customer</o:Author>
  <o:LastAuthor>Federated User</o:LastAuthor>
  <o:Revision>82</o:Revision>
  <o:TotalTime>2149</o:TotalTime>
  <o:Created>2000-10-07T00:22:22Z</o:Created>
  <o:LastSaved>2001-05-31T12:11:28Z</o:LastSaved>
  <o:Company>Dell</o:Company>
  <o:Version>9.3821</o:Version>
 </o:DocumentProperties>
 <o:OfficeDocumentSettings>
  <o:DownloadComponents/>
  <o:LocationOfComponents HRef="file:///I:/msowc.cab"/>
 </o:OfficeDocumentSettings>
</xml><![endif]-->


<script language=vbscript >
dim cnUWSA
dim rsbidsTable
dim vbtxtlastname
dim varItemName

On Error Resume Next

response = acDataContinue
'Used to get users logon id automatically.
'Dim strUserName
'Dim WSHNetwork    

'   Set WSHNetwork = CreateObject("WScript.Network")
'   strUserName = WSHNetwork.username

sub enterbid

'txtBidderid.Value = strUserName
If txtyourbid.value = "" Then
msgbox "You must enter in your bid amount in order to submit your bid."
exit sub
End If

If txtholdfirstname.value = "" Then
msgbox "You must enter in your first name in order to submit your bid."
exit sub
End If

If txtholdMI.value = "" Then
msgbox "You must enter in your Middle Initial in order to submit your bid."
exit sub
End If

If txtholdLastName.value = "" Then
msgbox "You must enter in your last name in order to submit your bid."
exit sub
End If

If txtholdext.value = "" Then
msgbox "You must enter in your Extension in order to submit your bid."
exit sub
End If

If txtholdid.value = "" Then
msgbox "You must enter in your Federated Six Digit ID Number in order to submit your bid."
exit sub
End If

If cint(txtYourbid.value) <= cint(txtCurrentBid.value) Then
msgbox "Your bid must be greater than the previous bid"
else
'Used for getting users logon id automatically.
'txtBidderID.value = txtBidderID.value
'txtbidder.value = txtBidderID.value
'store the 3rd highest bidders information
Bid3.value = Bid2.value
ext3.value = ext2.value
firstname3.value = firstname2.value
middleinitial3.value = middleinitial2.value
lastname3.value = lastname2.value
id3.value = id2.value

' store the 2nd highest bidders information
bid2.value = txtCurrentBid.value
ext2.value = txtExt.value
firstname2.value = txtFirstName.value
middleinitial2.value = txtMiddleInitial.value
lastname2.value = txtLastName.value
id2.value = id.value

txtCurrentBid.value = txtYourbid.value
txtFirstName.value = txtholdfirstname.value
txtMiddleInitial.value = txtholdmi.value
txtLastName.value = txtHoldLastName.value
txtExt.value = txtholdext.value
id.value = txtholdid.value



txtYourbid.value = ""

msgbox "Your bid has been submitted.  Thank-you."
End If

' ********************************************
' **** This is where I am having trouble! ****
' ********************************************

' ***** Start of script for putting information into Bids Table *********

vbtxtlastname = txtlastname.value
varitemname = vbtxtlastname
msgbox vbtxtlastname

            <%

            'Sub enterBidsTable
            'connect to the bids table
                  dim objconn
                  

            'Create and open the database object
                  Set objConn=Server.CreateObject("ADODB.Recordset")
            '      objconn.open, "Bids", "dsn=unitedway",adopendynamic,adlockpessimistic
            
            'varitemname = "Saturday Blues                                  "
            'varitemname = vbtxtlastname
            'varItemName = txtLastName
            'varItemName = txtLastName.value
            varItemName = Request("txtLastName")
            sqltext = "insert into Bids (item, Type_of_Item, Item_Name, Item_Description, Current_Bid, ID, First_Name, Last_Name, Middle_Initial, Ext) values ('6969', 'UWTEST', '" & varItemName & "', 'Big comfy leather couch', '100', '22813', 'John', '844', 'B', '1234' );"
            'sqltext = "insert into Bids (item, Type_of_Item, Item_Name, Item_Description, Current_Bid, ID, First_Name, Last_Name, Middle_Initial, Ext) values ('6969', 'UWTEST', 'Beast', 'Big comfy leather couch', '100', '22813', 'John', '844', 'B', '1234' );"
            'Response.write varItemName

            objconn.open sqltext, "dsn=Unitedway"
            set objconn = nothing
            'objconn.close
            'end sub
            %>

' ***** End of script for putting information into Bids Table *********



end sub
</SCRIPT>

            


<META content="blends 011" name="Microsoft Theme 2.00"><LINK
href="./2001UW_files/file0004.css" id=mstheme rel=StyleSheet type=text/css><LINK
href="./2001UW_files/file0005.css" id=mstheme rel=StyleSheet type=text/css><LINK
href="./2001UW_files/file0010.css" id=mstheme rel=StyleSheet type=text/css>
<SCRIPT event=onclick for=cmdSearch language=vbscript>
<!--
window.location.href ="G:\United Way 2001\2001UWSAFind.htm"

-->
</SCRIPT>




<SCRIPT event=onclick for=cmdExit language=vbscript>
<!--
window.close ()
-->
</SCRIPT>

<SCRIPT event=onclick for=cmdViewAll language=vbscript>
<!--
window.location.href ="G:\United Way 2001\2001UWSAFindAll.htm"
-->
</SCRIPT>

<SCRIPT event=onclick for=cmdYourBids language=vbscript>
<!--
window.location.href ="G:\United Way 2001\User ID.htm"
-->
</SCRIPT>
</HEAD>
<BODY bottomMargin=48 leftMargin=24 rightMargin=24
style="OVERFLOW: auto" topMargin=24 background="blegtext.gif" bgcolor="#CCCCCC" text="#000000" link="#993300" vlink="#0000FF" alink="#FF9900">
<!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">
            
            <!--mstheme--></font>
<H1 align=left id=HeadingText
style="FONT-WEIGHT: normal; MARGIN-RIGHT: 0px"><!--mstheme--><font face="Trebuchet MS, Arial, Helvetica" color="#330099"><font size="1"><IMG
alt=Image0 id=Image0 src="file:///G:/United%20Way%202001/United%20Way%202001%20Logo10.gif" tabIndex=44
title=Image0></font><!--mstheme--></font></H1>
<!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">
<DIV class=MicrosoftAccessBanner id=HeaderSilentAuctionBanner
style="BACKGROUND-COLOR: buttonface; BORDER-BOTTOM: buttonhighlight 2px outset; BORDER-LEFT: buttonhighlight 2px outset; BORDER-RIGHT: buttonhighlight 2px outset; BORDER-TOP: buttonhighlight 2px outset; DISPLAY: none; FONT-FAMILY: Tahoma; FONT-SIZE: 8pt; FONT-WEIGHT: normal; HEIGHT: 0.2in; OVERFLOW: hidden; PADDING-LEFT: 1px; WIDTH: 693px"><font size="1">Header:
SilentAuction</font></DIV>
<DIV class=MSOShowDesignGrid id=HeaderSilentAuction
style="BACKGROUND-COLOR: transparent; HEIGHT: 418px; POSITION: relative; VISIBILITY: hidden; WIDTH: 693px"><font size="1"><SPAN
class=MSTheme-Label id=Item#_Label
style="height: 22; left: 4; overflow: visible; position: absolute; top: 65; width: 46; padding-left: 1px"
title=Item#>Item #</SPAN><TEXTAREA id=txtItem readOnly style="BORDER-BOTTOM-COLOR: #c0c0c0; BORDER-LEFT-COLOR: #c0c0c0; BORDER-RIGHT-COLOR: #c0c0c0; BORDER-TOP-COLOR: #c0c0c0; COLOR: black; HEIGHT: 0.187in; LEFT: 1.208in; OVERFLOW: hidden; POSITION: absolute; TEXT-ALIGN: left; TOP: 0.667in; WIDTH: 58px" tabIndex=1 title=Item# rows="1" cols="20"></TEXTAREA><SPAN
class=MSTheme-Label id=TypeofItem_Label
style="height: 22; left: 4; overflow: visible; position: absolute; top: 90; width: 64; padding-left: 1px"
title=TypeofItem>Type of Item</SPAN><TEXTAREA id=txtTypeofItem readOnly style="BORDER-BOTTOM-COLOR: #c0c0c0; BORDER-LEFT-COLOR: #c0c0c0; BORDER-RIGHT-COLOR: #c0c0c0; BORDER-TOP-COLOR: #c0c0c0; HEIGHT: 0.187in; LEFT: 1.208in; OVERFLOW: hidden; POSITION: absolute; TOP: 0.917in; WIDTH: 1in" tabIndex=2 title=TypeofItem rows="1" cols="20"></TEXTAREA><SPAN
class=MSTheme-Label id=ItemName_Label
style="HEIGHT: 0.166in; LEFT: 0.042in; OVERFLOW: visible; PADDING-LEFT: 1px; POSITION: absolute; TOP: 1.167in; WIDTH: 1in"

title=ItemName>Item Name</SPAN><TEXTAREA id=txtItemName readOnly style="BORDER-BOTTOM-COLOR: #c0c0c0; BORDER-LEFT-COLOR: #c0c0c0; BORDER-RIGHT-COLOR: #c0c0c0; BORDER-TOP-COLOR: #c0c0c0; HEIGHT: 22px; LEFT: 1.208in; OVERFLOW: hidden; POSITION: absolute; TOP: 1.157in; WIDTH: 2.917in" tabIndex=3 title=ItemName rows="1" cols="20"></TEXTAREA><SPAN
class=MSTheme-Label id=ItemDescription_Label
style="HEIGHT: 0.166in; LEFT: 0.042in; OVERFLOW: visible; PADDING-LEFT: 1px; POSITION: absolute; TOP: 1.417in; WIDTH: 1in"

title=ItemDescription>Item Description</SPAN><TEXTAREA id=txtItemDescription readOnly style="BORDER-BOTTOM-COLOR: #c0c0c0; BORDER-LEFT-COLOR: #c0c0c0; BORDER-RIGHT-COLOR: #c0c0c0; BORDER-TOP-COLOR: #c0c0c0; HEIGHT: 60px; LEFT: 116px; OVERFLOW: hidden; POSITION: absolute; TOP: 140px; WIDTH: 402px" tabIndex=4 title=ItemDescription rows="1" cols="20"></TEXTAREA><SPAN
class=MSTheme-Label id=ApproximateValue_Label
style="height: 44; left: 4; overflow: visible; position: absolute; top: 208; width: 92; padding-left: 1px"
title=ApproximateValue>Approximate Value</SPAN><TEXTAREA id=txtApproximateValue readOnly style="BORDER-BOTTOM-COLOR: #c0c0c0; BORDER-LEFT-COLOR: #c0c0c0; BORDER-RIGHT-COLOR: #c0c0c0; BORDER-TOP-COLOR: #c0c0c0; HEIGHT: 0.187in; LEFT: 1.208in; OVERFLOW: hidden; POSITION: absolute; TOP: 2.167in; WIDTH: 1in" tabIndex=5 title=ApproximateValue rows="1" cols="20"></TEXTAREA><BUTTON
id=cmdSubmitBid
style="BACKGROUND-COLOR: #c0c0c0; COLOR: black; HEIGHT: 47px; LEFT: 544px; POSITION: absolute; TOP: 60px; WIDTH: 127px"
tabIndex=10 title=Command1>Submit Bid</BUTTON><BUTTON id=cmdExit
style="BACKGROUND-COLOR: #c0c0c0; COLOR: black; HEIGHT: 47px; LEFT: 544px; POSITION: absolute; TOP: 284px; VISIBILITY: visible; WIDTH: 127px"
tabIndex=11 title=Command3>
  </font>
<P>Exit</P><font size="1"></BUTTON><SPAN class=MSTheme-Label id=CurrentBid1_Label
style="HEIGHT: 0.166in; LEFT: 0.042in; OVERFLOW: visible; PADDING-LEFT: 1px; POSITION: absolute; TOP: 2.667in; WIDTH: 1in"
title=CurrentBid1>Your Bid</SPAN><TEXTAREA id=txtYourbid style="BORDER-BOTTOM-COLOR: rgb(0,0,0); BORDER-LEFT-COLOR: rgb(0,0,0); BORDER-RIGHT-COLOR: rgb(0,0,0); BORDER-TOP-COLOR: rgb(0,0,0); HEIGHT: 0.187in; LEFT: 1.208in; OVERFLOW: hidden; POSITION: absolute; TOP: 2.667in; WIDTH: 1in" tabIndex=1 title=CurrentBid1 rows="1" cols="20"></TEXTAREA><SPAN
class=MSTheme-Label id=Text1_Label
style="HEIGHT: 0.166in; LEFT: 3.458in; OVERFLOW: visible; PADDING-LEFT: 1px; POSITION: absolute; TOP: 2.208in; VISIBILITY: hidden; WIDTH: 1in"
title=Text1>Your Bidder ID</SPAN><TEXTAREA id=txtBidderID style="BORDER-BOTTOM-COLOR: #c0c0c0; BORDER-LEFT-COLOR: #c0c0c0; BORDER-RIGHT-COLOR: #c0c0c0; BORDER-TOP-COLOR: #c0c0c0; HEIGHT: 0.166in; LEFT: 4.625in; OVERFLOW: hidden; POSITION: absolute; TOP: 2.25in; VISIBILITY: hidden; WIDTH: 1in" tabIndex=13 title=Text1 rows="1" cols="20"></TEXTAREA><SPAN
class=MSTheme-Label id=ItemName_Label1
style="HEIGHT: 36px; LEFT: 126px; OVERFLOW: visible; PADDING-LEFT: 1px; POSITION: absolute; TEXT-ALIGN: center; TOP: 4px; WIDTH: 252px"
title=ItemName>Use the Box Below to find the item you would like to place a bid
on.</SPAN><SELECT id=ItemName
style="HEIGHT: 22px; LEFT: 116px; POSITION: absolute; TOP: 36px; WIDTH: 284px"
tabIndex=14 title=ItemName><OPTION selected></OPTION></SELECT><BUTTON
id=cmdSearch
style="BACKGROUND-COLOR: #c0c0c0; COLOR: black; HEIGHT: 47px; LEFT: 544px; POSITION: absolute; TOP: 116px; WIDTH: 127px"
tabIndex=15 title=Command0>Search UW Items</BUTTON><TEXTAREA id=txtBidder style="HEIGHT: 0.187in; LEFT: 4.667in; OVERFLOW: hidden; POSITION: absolute; TOP: 2.208in; VISIBILITY: hidden; WIDTH: 1in" tabIndex=16 title=Bidder rows="1" cols="20"></TEXTAREA><TEXTAREA id=txtFirstName style="HEIGHT: 18px; LEFT: 304px; OVERFLOW: hidden; POSITION: absolute; TOP: 280px; VISIBILITY: hidden; WIDTH: 47px" tabIndex=17 title=FirstName rows="1" cols="20"></TEXTAREA><TEXTAREA id=txtMiddleInitial style="HEIGHT: 18px; LEFT: 304px; OVERFLOW: hidden; POSITION: absolute; TOP: 304px; VISIBILITY: hidden; WIDTH: 46px" tabIndex=18 title=MiddleInitial rows="1" cols="20"></TEXTAREA><TEXTAREA id=txtLastName style="HEIGHT: 18px; LEFT: 304px; OVERFLOW: hidden; POSITION: absolute; TOP: 328px; VISIBILITY: hidden; WIDTH: 47px" tabIndex=20 title=LastName1 rows="1" cols="20"></TEXTAREA><SPAN
class=MSTheme-Label id=Text0_Label
style="HEIGHT: 0.166in; LEFT: 0.042in; OVERFLOW: visible; PADDING-LEFT: 1px; POSITION: absolute; TOP: 2.917in; WIDTH: 1in"
title=Text0>Your First Name</SPAN><TEXTAREA id=txtHoldFirstName style="HEIGHT: 18px; LEFT: 116px; OVERFLOW: hidden; POSITION: absolute; TOP: 280px; WIDTH: 152px" tabIndex=2 title=Text0 rows="1" cols="20"></TEXTAREA><SPAN
class=MSTheme-Label id=txtHoldFirstName1_Label
style="HEIGHT: 0.166in; LEFT: 0.042in; OVERFLOW: visible; PADDING-LEFT: 1px; POSITION: absolute; TOP: 3.167in; WIDTH: 1in"
title=Text0>Your Middle Initial</SPAN><TEXTAREA id=txtHoldMI style="HEIGHT: 18px; LEFT: 116px; OVERFLOW: hidden; POSITION: absolute; TOP: 304px; WIDTH: 26px" tabIndex=3 title=Text0 rows="1" cols="20"></TEXTAREA><SPAN
class=MSTheme-Label id=txtHoldMI2_Label
style="HEIGHT: 0.166in; LEFT: 0.042in; OVERFLOW: visible; PADDING-LEFT: 1px; POSITION: absolute; TOP: 3.417in; WIDTH: 1in"
title=Text0>Your Last Name</SPAN><TEXTAREA id=txtHoldLastName style="HEIGHT: 18px; LEFT: 1.208in; OVERFLOW: hidden; POSITION: absolute; TOP: 3.417in; WIDTH: 152px" tabIndex=4 title=Text0 rows="1" cols="20"></TEXTAREA><TEXTAREA id=txtExt style="HEIGHT: 18px; LEFT: 304px; OVERFLOW: hidden; POSITION: absolute; TOP: 372px; VISIBILITY: hidden; WIDTH: 48px" tabIndex=24 title=Ext rows="1" cols="20"></TEXTAREA><SPAN
class=MSTheme-Label id=txtHoldLastName3_Label
style="HEIGHT: 0.166in; LEFT: 0.042in; OVERFLOW: visible; PADDING-LEFT: 1px; POSITION: absolute; TOP: 3.917in; WIDTH: 1in"
title=Text0>Your Phone Ext</SPAN><TEXTAREA id=txtholdext style="HEIGHT: 18px; LEFT: 116px; OVERFLOW: hidden; POSITION: absolute; TOP: 376px; WIDTH: 61px" tabIndex=5 title=Text0 rows="1" cols="20"></TEXTAREA><TEXTAREA id=Firstname2 style="HEIGHT: 18px; LEFT: 360px; OVERFLOW: hidden; POSITION: absolute; TOP: 280px; VISIBILITY: hidden; WIDTH: 53px" tabIndex=26 title=2ndFirstname rows="1" cols="20"></TEXTAREA><TEXTAREA id=Lastname2 style="HEIGHT: 18px; LEFT: 364px; OVERFLOW: hidden; POSITION: absolute; TOP: 328px; VISIBILITY: hidden; WIDTH: 54px" tabIndex=27 title=2ndLastname rows="1" cols="20"></TEXTAREA><TEXTAREA id=MiddleInitial2 style="HEIGHT: 18px; LEFT: 360px; OVERFLOW: hidden; POSITION: absolute; TOP: 304px; VISIBILITY: hidden; WIDTH: 53px" tabIndex=28 title=2ndMiddleInitial rows="1" cols="20"></TEXTAREA><TEXTAREA id=Ext2 style="HEIGHT: 18px; LEFT: 360px; OVERFLOW: hidden; POSITION: absolute; TOP: 372px; VISIBILITY: hidden; WIDTH: 54px" tabIndex=29 title=2ndExt rows="1" cols="20"></TEXTAREA><TEXTAREA id=Firstname3 style="HEIGHT: 18px; LEFT: 424px; OVERFLOW: hidden; POSITION: absolute; TOP: 280px; VISIBILITY: hidden; WIDTH: 53px" tabIndex=30 title=3rdFirstname rows="1" cols="20"></TEXTAREA><TEXTAREA id=LastName3 style="HEIGHT: 18px; LEFT: 424px; OVERFLOW: hidden; POSITION: absolute; TOP: 328px; VISIBILITY: hidden; WIDTH: 53px" tabIndex=31 title=3rdLastName rows="1" cols="20"></TEXTAREA><TEXTAREA id=MiddleInitial3 style="HEIGHT: 18px; LEFT: 424px; OVERFLOW: hidden; POSITION: absolute; TOP: 304px; VISIBILITY: hidden; WIDTH: 53px" tabIndex=32 title=3rdMiddleInitial rows="1" cols="20"></TEXTAREA><TEXTAREA id=Ext3 style="HEIGHT: 18px; LEFT: 424px; OVERFLOW: hidden; POSITION: absolute; TOP: 372px; VISIBILITY: hidden; WIDTH: 54px" tabIndex=33 title=3rdExt rows="1" cols="20"></TEXTAREA><TEXTAREA id=Bid2 style="HEIGHT: 18px; LEFT: 360px; OVERFLOW: hidden; POSITION: absolute; TOP: 256px; VISIBILITY: hidden; WIDTH: 52px" tabIndex=34 title=2ndBid rows="1" cols="20"></TEXTAREA><TEXTAREA id=Bid3 style="HEIGHT: 18px; LEFT: 428px; OVERFLOW: hidden; POSITION: absolute; TOP: 256px; VISIBILITY: hidden; WIDTH: 47px" tabIndex=35 title=3rdBid rows="1" cols="20"></TEXTAREA><SPAN
class=MSTheme-Label id=CurrentBid_Label
style="HEIGHT: 0.166in; LEFT: 0.042in; OVERFLOW: visible; PADDING-LEFT: 1px; POSITION: absolute; TOP: 2.417in; WIDTH: 1in"
title=CurrentBid>Current Bid</SPAN><TEXTAREA id=txtCurrentBid readOnly style="BORDER-BOTTOM-COLOR: #c0c0c0; BORDER-LEFT-COLOR: #c0c0c0; BORDER-RIGHT-COLOR: #c0c0c0; BORDER-TOP-COLOR: #c0c0c0; HEIGHT: 0.187in; LEFT: 1.208in; OVERFLOW: hidden; POSITION: absolute; TEXT-ALIGN: left; TOP: 2.417in; WIDTH: 1in" tabIndex=36 title=CurrentBid rows="1" cols="20"></TEXTAREA><TEXTAREA id=ID style="HEIGHT: 18px; LEFT: 304px; OVERFLOW: hidden; POSITION: absolute; TOP: 352px; VISIBILITY: hidden; WIDTH: 47px" tabIndex=38 title=ID rows="1" cols="20"></TEXTAREA><TEXTAREA id=ID2 style="HEIGHT: 18px; LEFT: 364px; OVERFLOW: hidden; POSITION: absolute; TOP: 352px; VISIBILITY: hidden; WIDTH: 52px" tabIndex=39 title=2ndID rows="1" cols="20"></TEXTAREA><TEXTAREA id=ID3 style="HEIGHT: 18px; LEFT: 424px; OVERFLOW: hidden; POSITION: absolute; TOP: 352px; VISIBILITY: hidden; WIDTH: 50px" tabIndex=40 title=3rdID rows="1" cols="20"></TEXTAREA><SPAN
class=MSTheme-Label id=Text1_Label1
style="HEIGHT: 0.166in; LEFT: 0.083in; OVERFLOW: visible; PADDING-LEFT: 1px; POSITION: absolute; TOP: 3.667in; WIDTH: 1in"
title=Text1>6 Digit ID Number</SPAN><TEXTAREA id=txtholdid style="HEIGHT: 0.166in; LEFT: 1.208in; OVERFLOW: hidden; POSITION: absolute; TOP: 3.666in; WIDTH: 1.541in" tabIndex=41 title=Text1 rows="1" cols="20"></TEXTAREA><BUTTON
id=cmdViewAll
style="BACKGROUND-COLOR: #c0c0c0; COLOR: black; HEIGHT: 47px; LEFT: 5.667in; POSITION: absolute; TOP: 1.792in; WIDTH: 127px"
tabIndex=42 title=Command0>View All UW Items</BUTTON><BUTTON id=cmdYourBids
style="BACKGROUND-COLOR: #c0c0c0; COLOR: black; HEIGHT: 47px; LEFT: 5.667in; POSITION: absolute; TOP: 2.375in; WIDTH: 127px"
tabIndex=43 title=Command0>View Your Bids</BUTTON></font></DIV>
<DIV class=MicrosoftAccessBanner id=NavigationSectionSilentAuctionBanner
style="BACKGROUND-COLOR: buttonface; BORDER-BOTTOM: buttonhighlight 2px outset; BORDER-LEFT: buttonhighlight 2px outset; BORDER-RIGHT: buttonhighlight 2px outset; BORDER-TOP: buttonhighlight 2px outset; DISPLAY: none; FONT-FAMILY: Tahoma; FONT-SIZE: 8pt; FONT-WEIGHT: normal; HEIGHT: 0.2in; OVERFLOW: hidden; PADDING-LEFT: 1px; WIDTH: 693px"><font size="1">NavigationSection:
SilentAuction</font></DIV>
<DIV class=MSOShowDesignGrid id=NavigationSectionSilentAuction
style="BACKGROUND-COLOR: transparent; HEIGHT: 35px; OVERFLOW: hidden; POSITION: relative; VISIBILITY: hidden; WIDTH: 693px">
<font size="1">
<OBJECT classid=CLSID:0002E531-0000-0000-C000-000000000046
codeBase=file:///I:/msowc.cab id=SilentAuctionNavigation
style="LEFT: 8px; POSITION: absolute; TOP: 5px; VISIBILITY: hidden; WIDTH: 384px" width="454" height="24"><PARAM NAME="_State" VALUE=""><PARAM NAME="RecordSource" VALUE="SilentAuction"><PARAM NAME="RecordsetLabel" VALUE="SilentAuction |0 of |2;SilentAuction |0-|1 of |2"><PARAM NAME="ShowFirstButton" VALUE="-1"><PARAM NAME="ShowPrevButton" VALUE="-1"><PARAM NAME="ShowNextButton" VALUE="-1"><PARAM NAME="ShowLastButton" VALUE="-1"><PARAM NAME="ShowNewButton" VALUE="-1"><PARAM NAME="ShowDelButton" VALUE="-1"><PARAM NAME="ShowSaveButton" VALUE="-1"><PARAM NAME="ShowUndoButton" VALUE="-1"><PARAM NAME="ShowSortAscendingButton" VALUE="-1"><PARAM NAME="ShowSortDecendingButton" VALUE="-1"><PARAM NAME="ShowApplyFilterButton" VALUE="-1"><PARAM NAME="ShowToggleFilterButton" VALUE="-1"><PARAM NAME="ShowHelpButton" VALUE="-1"><PARAM NAME="ShowLabel" VALUE="-1"><PARAM NAME="FontName" VALUE="Tahoma"></OBJECT></font></DIV>
<P>&nbsp;</P><!--mstheme--></font></BODY>
            </html>



<SCRIPT event=onclick for=cmdSubmitBid language=vbscript>
<!--

enterbid




-->
</SCRIPT>



<SCRIPT event=onclick for=cmdCurrentBids language=vbscript>
<!--
window.close ()
-->
</SCRIPT>

<SCRIPT event=onclick for=ItemName language=vbscript>
<!--
'txtBidderid.Value = strUserName
-->
</SCRIPT>



0
 

Author Comment

by:flfmmqp
Comment Utility
I thought I should mention also that I am running this on Personell Web Server.

M!
0
 
LVL 15

Accepted Solution

by:
robbert earned 200 total points
Comment Utility
Hi flfmmqp,
I was looking at your question before but there may be alot involved to make it work as you are a starter.

ASP code is processed at the server - to client side code. At the client side, any ASP object is not available. - I.e.:

<%
Response.Write "<script>sdf</script>"
%>

works. The following does not work:

<%
Function WriteX()
    Response.Write "X"
End Function
%>
<script>
Call WriteX
</script>

-----------------------------------------------------------

Thus, you need to submit your pages, by a link or by submitting a form. That way, you can transfer information (as a querystring, or posted form fields) to the server, where they're processed by ASP. - I.e.,

<SCRIPT event=onclick for=cmdSubmitBid language=vbscript>
dim vbtxtlastname
vbtxtlastname = txtlastname.value

document.location.href = "page.asp?lastname=vbtxtlastname"
</script>

In page.asp, you'ld receive the querystring, process it, and generate client-side code, again. - I.e.,

<%
vbtxtlastname = Request.QueryString("lastname")
If vbtxtlastname = "" Then
    ' error handling or whatever
Else
              Set objConn=Server.CreateObject("ADODB.Recordset")
objconn.open, "Bids", "dsn=unitedway",adopendynamic,adlockpessimistic
         
         sqltext = "insert into Bids (item, Type_of_Item, Item_Name, Item_Description, Current_Bid,
ID, First_Name, Last_Name, Middle_Initial, Ext) values ('6969', 'UWTEST', '" & VBTXTLASTNAME & "', 'Big
comfy leather couch', '100', '22813', 'John', '844', 'B', '1234' );"

         objconn.EXECUTE sqltext, "dsn=Unitedway"
         set objconn = nothing
End If
%>

HTML here...

-----------------------------------------------------------

There are other weaknesses in your attempts, too, as, you cannot "open" an INSERT statement, and it won't return a value.
It's a bad situation if there is a deadline and you're not aware of basics. Try to get yourself some time, and make decisions being real. :-)
0
 

Author Comment

by:flfmmqp
Comment Utility
Robbert:

Thanks for helping.  My only problem currently is reading the from the text boxes with the ASP.  I can read from them fine in the VBScript but the problem is that I can only read/write to one database with that information.  My insert sql actually works if I just use something like varitemname = "Saturday Blues.  Again my big problem is reading from the text box.                                  

I was kind of getting the feeling tat I was going to have to do something like what you are suggesting.  I will give your code a try and let you know how it turns out.  Be back in a jiffy.

M!

0
 
LVL 15

Expert Comment

by:robbert
Comment Utility
> My insert sql actually works if I just use something like varitemname = "Saturday
Blues.

Because you're filling that variable at the server side, where you do the INSERT.

When you have reached the client-side, the server-side code is already processed, and you can't assign to server-side variables by client-side code without re-submitting the page, and transferring variables via querystring, or posted form fields.
0
 
LVL 15

Expert Comment

by:robbert
Comment Utility
You need to realize that server-side (ASP) code is processed before the (resulting) client-side code is sent out.

Server-side code produces client-side code (HTML, VBScript, whatever), they cannot interact. Get THAT.
0
 

Author Comment

by:flfmmqp
Comment Utility
I am trying your code but running into some small errors that I am trying to work around.  I believe If I can get this to work then I will be set.


I dont understand this line very well.
if you put the value of txtlastname.value into a string called vbtxtlastname then why do you do lastname=vbtxtlastname?

document.location.href = "page.asp?lastname=vbtxtlastname?"

Another question if you had more than one text box would it look like this.

document.location.href = "page.asp?lastname=vbtxtlastname?firstname=vbtxtfirstname?"

0
 
LVL 15

Expert Comment

by:robbert
Comment Utility
Sorry, that was an error in my pseudo code. Corrected:

vbtxtlastname = txtlastname.value
document.location.href = "page.asp?lastname=" & vbtxtlastname

> document.location.href = "page.asp?lastname=vbtxtlastname?firstname=vbtxtfirstname?"

document.location.href = "page.asp?lastname=" & vbtxtlastname & "&firstname=" & vbtxtfirstname

- At the next page, you can get the querystring parameters by,
x = Request.QueryString("lastname")
y = Request.QueryString("firstname")

- Btw, at http://www9.ewebcity.com/robbert/asp.zip , there's the ASP reference in compiled help format; could be useful, but not for everything.

- I'll go to sleep in some minutes, sorry. Until then.
0
 
LVL 15

Expert Comment

by:robbert
Comment Utility
document.location.href = "page.asp?lastname=" & vbtxtlastname & "&firstname=" & vbtxtfirstname

The querystring starts with a ?
The name/value pairs are divided by &

There is an additional issue using the querystring. You need to URLencode special characters, like spaces (if you target other browsers than Internet Explorer). So, it is,

document.location.href = "page.asp?lastname=" & escape(vbtxtlastname) & "&firstname=" & escape(vbtxtfirstname)

--------------------------------------------

You can also submit your form:

<form name=frmMain action="nextpage.asp" method=get>
<input type=text name=vbtxtlastname>
<input type=text name=vbtxtfirstname>

and in your client-side script, you would just state,

document.frmMain.submit()

Again, at nextpage.asp, you can retrieve that by,
x = Request.QueryString("vbtxtlastname")
y = Request.QueryString("vbtxtfirstname")
0
 

Author Comment

by:flfmmqp
Comment Utility
I am only worried about Internet explorer.

I am having a problem.  I don't think the first page is sending correctly to the second page.  

First page<SCRIPT event=onclick for=cmdSubmitBid language=vbscript>
<!--
         
enterbid

'trying to save information to another page to put into bids table in uswa.mdb
dim vbtxtlastname

vbtxtlastname = txtlastname.value
document.location.href = "page.asp?lastname=" & vbtxtlastname


-->
</SCRIPT>

Second page called page.asp - which is saved in the wwwroot folder along with the default.asp (1st page)


<%
     Dim vbtxtLName
          vbtxtLName = Request.QueryString("lastname")
     If vbtxtLName = "" Then
             ' error handling or whatever
     Else
             Set objConn=Server.CreateObject("ADODB.Recordset")
          'objconn.open "Bids", "dsn=unitedway",adopendynamic,adlockpessimistic
       
        sqltext = "insert into Bids (item, Type_of_Item, Item_Name, Item_Description, Current_Bid, ID, First_Name, Last_Name, Middle_Initial, Ext) values ('6969', 'UWTEST', '" & vbtxtLName & "', 'Big comfy leather couch', '100', '22813', 'John', '844', 'B', '1234' );"

        objconn.Open sqltext, "dsn=Unitedway"
'        objconn.EXECUTE sqltext, "dsn=Unitedway"
        set objconn = nothing
     End If
%>
0
 
LVL 15

Expert Comment

by:robbert
Comment Utility
> I don't think the first page is sending correctly to the second page.  

(I'm going to sleep, now. Maybe, someone else steps in. I'll be there again, tomorrow.)

Can we turn over to posting the relevant code that errors out, the line, and exact error messages. G'luck.
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:flfmmqp
Comment Utility
I get a box that pops up Are you sure you want to navigate away from this page?  Warning.  You have modified data and not saved changes.  If you click ok your changes will be discarded. etc . .

Then the address on IE comes up
http://unitedway/page.asp?lastname=Bone
Which Bone is the last name I put in.  I guess that is a good sign.  But it does not bring up my page (page.asp)

Thanks for trying to help Roberts.

M!
0
 
LVL 2

Expert Comment

by:RickHalle
Comment Utility
I would not use Request.QueryString if you are working from one asp page to another. It tends to scare people when they see their name in the address bar and has some limitations regarding length as well. I only use it for passing data between domains and even then I limit it to as little as possible. Instead use the post(method=post) in your forms after which you use Request.Form to get the information on the page it is posted to. Here's a short example of how to pass data from a form and use it.

Page 1(Input page)
<form name="form1" method="post" action="page2.asp">
<input type="text" name="sometext" size="10">
<input type="submit" value="Submit">
</form>

Page 2(post page)
<%
Dim sometext 'Declare sometext as a variable
sometext=Request.Form("sometext") 'assign the value of the sometext form item on the previous page to the sometext variable
%>
......
<%=sometext%>(This is the sometext variable written to the page, it could be used in other functions such as adding it to a database instead)

Rick

0
 
LVL 15

Expert Comment

by:robbert
Comment Utility
> I would not use Request.QueryString

Agreed, but using the querystring should be easier to get this working.

> But it does not bring up my page
(page.asp)

Using which code?
0
 
LVL 2

Expert Comment

by:RickHalle
Comment Utility
What I gave was a very simple example of how to pass data using Request.Form. If you created two files one caled page1.asp and one called page2.asp and pasted just the code I display(except "the sometext variable" which wrapped down) into the appropriate pages then if you launch page1.asp it will bring up a text box. Type something in it and click submit. The page that loads will display what you typed. Rather than convert the original code I supplied the simplest example with nothing extra that I could come up with. If I were to rework the original file I would need to go line by line and format it so that it was easy to read. Then step through the result checking tags, commands, etc. Considering the size of the file this would be tedious and require a large amount of time.
0
 
LVL 2

Expert Comment

by:RickHalle
Comment Utility
Something else might be worth pointing out. This file has a large xml data island at the top. I'm not certain what it is used for nevertheless it is there. If you are just posting data from user input then it might just be taking up unnecessary resources (In addition to confusing the question).

Rick
0
 
LVL 15

Expert Comment

by:robbert
Comment Utility
Starting with something that works, and then extending, is a good method.
0
 
LVL 2

Expert Comment

by:RickHalle
Comment Utility
One more note regarding the code I posted. I added in a name="form1" that is not needed to make this work. I included it though because it a good habit to name the forms in case you put 2 in a page. Kind of like quotes around attribute values. HTML could care less but xml parsers require them to be there. If your in the habit of always using them then it makes it easier to use xml. For that matter Post is the default method for forms and you should be able to leave it out also.(I do not suggest doing so though)

Rick
0
 
LVL 19

Expert Comment

by:webwoman
Comment Utility
Frankly, I'd trash everything you have and just start over. You've got so much MS crap in there it's going to be pretty much impossible to figure out what's necessary and what's not.

IMHO, that's what most of your problem is. You're trying to fix things, and without knowing what's REALLY going on it's a real uphill battle -- and you've pretty much admitted that you really don't understand how any of it works, or why it works or doesn't work.

FWIW, this would have been a really easy change IF you had written the code yourself. Then you would have known what each piece of code did and would have had no problems making changes.

This is my biggest complaint with WYSI(N)WYG editors -- they let you do stuff with absolutely no idea what it is or why it works, and then make what should be minor modifications extremely difficult.
0
 
LVL 2

Expert Comment

by:RickHalle
Comment Utility
Kind of like pushing the start button on your computer. It lets you do stuff with absolutely no idea what it is or why it works.

Rick
0
 

Author Comment

by:flfmmqp
Comment Utility
First off I would like to say I love this group and thanks for all of you for trying to help.

I am a VB/VBA programmer and so this would seem to be a logical fit with the Access Data Pages.  While it is a pain in the neck the first time to figure out it will not be as difficult the second time around.  I have an idea of what a lot of the code is doing.  You can read between the lines and figure that out.  What my problem is, I have a lack of understanding of web programming and ASP.  

I think I am getting close and getting a better understanding of when to use VBScript versus ASP.  If I understand correctly I would be much better off using the VBSCRIPT on the client server side and ASP on the server side to process the information.  

I am using the code that puts the information into the URL on my main page.
I tried using my ASP alone on the pages.asp and it worked and then I tried creating a Data Access Page (which uses VBSCRIPT) with my ASP on the onload event and it didn't even see the ASP.

The scripting look like this(it actually does the msgbox but I am guessing that since language=vbscript is messing it up?):

<SCRIPT for=window event=onload language=vbscript>

msgbox "onload event working"


<%

     Dim ASPtxtLName
     Dim ASPtxtFName
     Dim ASPtxtItemName
     Dim ASPtxtItem
     Dim ASPtxtholdMI
     Dim ASPtxtYourBid
     Dim ASPtxtholdExt
     Dim ASPtxtholdID
     

     'dimadopendynamic
     'dim adlockpessimistic
     'adopendynamic = 2
     'adlockpessimistic = 2

     ASPtxtLName = Request.QueryString("lastname")
     ASPtxtFName = Request.QueryString("FirstName")
     ASPtxtItemName = Request.QueryString("ItemName")
     ASPtxtItem = Request.QueryString("ITEM")
     ASPtxtholdMI = Request.QueryString("holdMI")
     ASPtxtYourBid = Request.QueryString("YourBid")
     ASPtxtholdExt = Request.QueryString("holdExt")
     ASPtxtholdID = Request.QueryString("holdID")
     
     If ASPtxtLName = "" Then
             ' error handling or whatever
     Else
             Set objConn=Server.CreateObject("ADODB.Recordset")
          'objconn.open "Bids", "dsn=unitedway",adopendynamic,adlockpessimistic
       
sqltext = "insert into Bids (item, Item_Name, Your_Bid, ID, First_Name, Last_Name, Middle_Initial, Ext) values ('" & ASPtxtItem & "', '" & ASPtxtItemName & "', '" & ASPtxtYourBid & "', '" & ASPtxtholdID & "', '" & ASPtxtFName & "', '" & ASPtxtLName & "', '" & ASPtxtholdMI & "', '" & ASPtxtholdExt & "');"    

     End If
%>
</SCRIPT>

0
 
LVL 2

Expert Comment

by:RickHalle
Comment Utility

<SCRIPT for=window event=onload language=vbscript>-Start of client script event which should be closed before continueing

msgbox "onload event working"-script event


<%

    Dim ASPtxtLName- variables assigned which is working even thoough the  script was not closed yet I think
    Dim ASPtxtFName
    Dim ASPtxtItemName
    Dim ASPtxtItem
    Dim ASPtxtholdMI
    Dim ASPtxtYourBid
    Dim ASPtxtholdExt
    Dim ASPtxtholdID
   

    'dimadopendynamic-commented and doing nothing
    'dim adlockpessimistic
    'adopendynamic = 2
    'adlockpessimistic = 2

    ASPtxtLName = Request.QueryString("lastname")assign values to variables based on querystring used to access page("page.asp?FirstName=Test&ItemName=Item1" ,etc.)
    ASPtxtFName = Request.QueryString("FirstName")
    ASPtxtItemName = Request.QueryString("ItemName")
    ASPtxtItem = Request.QueryString("ITEM")
    ASPtxtholdMI = Request.QueryString("holdMI")
    ASPtxtYourBid = Request.QueryString("YourBid")
    ASPtxtholdExt = Request.QueryString("holdExt")
    ASPtxtholdID = Request.QueryString("holdID")
   
    If ASPtxtLName = "" Then- Check to see if a querystring is included if not the move forward
            ' error handling or whatever
    Else
            Set objConn=Server.CreateObject-("ADODB.Recordset")-if a querystring then create a recordset object(There should have been a connection object first) also declare the like you did the other stuff
         'objconn.open "Bids", "dsn=unitedway",adopendynamic,adlockpessimistic-commented however it looks like a valid connection string
       
sqltext = "insert into Bids (item, Item_Name, Your_Bid, ID, First_Name, Last_Name, Middle_Initial, Ext)
values ('" & ASPtxtItem & "', '" & ASPtxtItemName & "', '" & ASPtxtYourBid & "', '" & ASPtxtholdID &
"', '" & ASPtxtFName & "', '" & ASPtxtLName & "', '" & ASPtxtholdMI & "', '" & ASPtxtholdExt & "');"-sql statement

Missing call to execute the opening of database and sql statement
   
Missing call to close database and clean up variables

    End If
%>
</SCRIPT>-This should follow msgbox above

Rick
0
 

Author Comment

by:flfmmqp
Comment Utility
I wanted to say thanks to everyone who tried to help.  In the end this answer was what got me over the hump and provided me the most help.  

RickHallie(SP):
Thanks for your help as well.  I think I definatley need to look into ASP more.  Have to start somewhere.

M!
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This video discusses moving either the default database or any database to a new volume.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now