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("orderi d")
checkstatus = "checked"
If IsEmpty(Session ("computeship") ) Or Session("comput eship") = "" or
Session("comput eship") = " " Then
computeship = 1
Else
computeship = Session("comput eship")
End If
computemethod = FGetVar("comput emethod",1,"n")
country = FGetVar("countr y","US","s")
'maria's code starts here
If country <> US then
country = FGerVar("countr y","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.setCo nnectionString = Session("Connec tionString")
Set RS = SimpleAdo.getRe cordSet(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("T xtFreeShipping" )) 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.setCo nnectionString = Session("Connec tionString")
Set RS = SimpleAdo.getRe cordSet(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(thes hipping(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
%> 0 2763 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 use the code fragment
below the price variable, which is 3.92 in the database, shows up as £392.
When the formatcurrency is removed it is displayed as 3.92 but!!!! if I
concatenate a "£" it displays £392. I have read some posts about VBscript
not...
|
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 Gatto
Dan Guzman Apr 27 2000, 12:00 am show options
|
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 the Access I
have 2 tables, each one with less then 20 rows. The problem is, that
each time my application access the database, the response is about 30
second.
My questions:
1. How can I improve response time?
|
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 Access a way of
adding records to a access database from a simple web page. I don't
want to have to setup ODBC or anything like that I just want to put
the web page on the network for anyone to access. Most of the users
would use the local access...
|
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"%>
<!--#include virtual="/Connections/EmployeeStatusChange.asp" -->
<%
| |
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 in a cookie, then uses
vbscript to query a database. The page is reloaded by clicking a button
in another frame.
The problem I'm having is I have to reload the page twice (click the
button twice) before changed values are used. It seems like...
|
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. The plan is then to pass the information from ASP to VBScript. My dilemma is how to extract the information in ASP and use it in VBScript. (Please see code below)
I’ve read in some forums that is simply can’t be done. Unfortunately, I can’t run...
|
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 recordset varible
when user click the save button then some values save in the database so i write javascript function to add the records...
here is the code
|
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 results page.
- Recordset Paging works if no parameters are used in the recordset sql code (ie. simple sql code):
SELECT *
FROM db_name
WHERE (db_field1 LIKE ‘%text1%’ OR db_field2 LIKE ‘%text2%’)
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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 then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |