VBScript and ASP - Please help!!!
Posted on 2001-06-02
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>
vbtxtlastname = txtlastname.value
varitemname = vbtxtlastname
'connect to the bids table
'Create and open the database object
' 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' );"
objconn.open sqltext, "dsn=Unitedway"
set objconn = nothing