473,431 Members | 1,608 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,431 software developers and data experts.

VBScript used on html to capture values for a Access database

Hello,

I am trying to implement a sales cart application that uses VBScript
and writes the data to an Access database. This is a prepackage
software that I am trying to customize for my needs.

THe problem I am having is with a function that captures the country
where the order is coming from and selects from the database the
appropriate shipping costs. The default is the US. I am trying to avoid
having to enter a specific shipping cost for every country (I offer 4)
and would like to be able to use an If statement that would basically
say something like:
If country <> US then charge the shipping for country = OUS

I never used VBScript, .asp and Access together and am not getting much
help from tech support.
Any suggestion would be appreciated. Here is the code:

<%
order = Session("orderid")
checkstatus = "checked"

If IsEmpty(Session("computeship")) Or Session("computeship") = "" or
Session("computeship") = " " Then
computeship = 1
Else
computeship = Session("computeship")
End If

computemethod = FGetVar("computemethod",1,"n")

country = FGetVar("country","US","s")
'maria's code starts here
If country <> US then
country = FGerVar("country","AU","s")
End If
'READ STUFF to Database
Dim SimpleAdo, rstRS, SQLStmt

SQLStmt = "SELECT * FROM [order] "
SQLStmt = SQLStmt & "WHERE orderid=" & order & ";"
Set SimpleAdo = New CSimpleAdo
SimpleAdo.setConnectionString = Session("ConnectionString")
Set RS = SimpleAdo.getRecordSet(SQLStmt)

If CheckRS(RS) Then
subtotal = RS("subtotal")
subhand = RS("subhand")
subship = RS("subship")
End If
Set SimpleAdo = Nothing
Set RS = Nothing

'initialize variables

shipx = 0 'initial counter specifying what radio button was selected
dim theshipping(50,3) 'holds shipping information
dim shipdescription(50) 'holds shipping descriptions
dim shipcost(50) 'holds shipping costs
i = 0 'loop counter

'Determine if Free shipping applies
If CDbl(subtotal) > CDbl(Session("TxtFreeShipping")) Then
computemethod = 6
End If
'shipping based on Look-up tables
'read database variables into an array to save shipping variables
tablebased = True
'READ STUFF from Database
SQLStmt = "SELECT * From [x-Shipping] "
SQLStmt = SQLStmt & "WHERE Destination = '" & country & "' "
SQLStmt = SQLStmt & "and LowW<" & computeship & " and HighW>=" &
computeship & " "
SQLStmt = SQLStmt & "ORDER BY Cost; "
Set SimpleAdo = New CSimpleAdo
SimpleAdo.setConnectionString = Session("ConnectionString")
Set RS = SimpleAdo.getRecordSet(SQLStmt)
do until RS.eof
theshipping(i,1) = RS("Type")
theshipping(i,2) = RS("Service")
theshipping(i,3) = RS("Cost")
shipdescription(i) = RS("Description")
shipcost(i) = MyCurrency(theshipping(i,3))
i=i+1
RS.MoveNext
Loop
Set SimpleAdo = Nothing
Set RS = Nothing
End Select

subweight = computeship
j = i 'save # of rows
i = 0 'loop counter
%>

Nov 13 '05 #1
0 2738

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Chris Kennedy | last post by:
I am pulling a decimal value from SQL server and trying to use the format currency and format number function. I am using these values in a large string of HTML to be used in a CDONTS Email. If I...
4
by: chris.dunigan | last post by:
I'm looking for an example of how to execute an existing DTS­ package from an ASP (VB)script and would appreciate any and all response. ­I don't even know if it's possible Thanks - Chuck...
5
by: Zalek Bloom | last post by:
Hello, I am developing a simple ASP application with VBScript and Access database. I am testing it on my Win98SE machine using Personal Web Server. My machine is Celeron 2000 with 512Mb RAM. On...
9
by: Pete | last post by:
Does anyone have a simple html vbscript or other type of snippet they can share that appends a record to a access database via ADO or DAO? I would like to allow users that don't have Microsoft...
1
by: JNariss | last post by:
Hello, I have created a connection to my Access database with Dreamweaver and made a simple form with 4 fields. The code behind this form was/is: <%@LANGUAGE="VBCRIPT" CODEPAGE="1252"%>...
4
by: gmail | last post by:
Hi all-- I'm new to HTML and scripts and am having a problem with some code, pasted in at the bottom. It uses javascript to get values from a form in another frame, stores part of an SQL string...
2
by: moodyman13 | last post by:
Hi All, I’m in a bit of pickle with ASP and VBscript variable and hope someone could get me some advice. There’s a FORM’ I’ve created in ASP and its purpose is to capture the name(s) of users....
1
by: anniefs | last post by:
hi help me i m so much stuck int he code and i have no time .... i used ASP VBscipt and javascript functions with MS database javascript function add records in MS DB by using ASP vbscript...
2
by: wallconor | last post by:
Hi, I am having a problem using Dreamweaver CS3 standard recordset paging behavior. It doesn’t seem to work when I pass parameter values from a FORM on my search page, to the recordset on my...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.