How To Create SELECT QUERRY FOR A CHANGE ORDER FORM In ASP?

Jun 6, 2007

 Hello.

Hope you are all well and having a good day.

I've got a problem i would like you to help me out with. My

company has got a client who sells meat and my senior tech lead

has customized the cart to fit their needs and have created a

despatch table with a "simple asp form" that allows them

to scan their products in with a wi-fi scanner.



The despatch table has the following fields:

1. OrderID

2. Product

3. Quantit

4. sellbydate

5. traceabilitycode and

6. Weight

Question 1: how do i create a form in asp that allow a user to

view the order no, product and quantity

celibate,traceabilitybycode and Weight after scanning the

details into the simple form created?

Question 2: How can i create an asp form that allows users to

search for the Order that populates the orderid, Product,

quantity?

Question 3: How can i create an asp for that allows users to

search for Product with orderid,traceabilitycode and quantity?

Question 4: How can i create an asp form that allows users to

Trace: Orderid, traceabilitycode, sellbydate and Quantity?



Please find below the source code of both the:

despatchLotsRowsSimpleForm.asp that allow them to scan details

into the table and the despatchLotsExec.asp:



THE FORM:

<!#include file="../includes/settings.asp">

<!#include file="../includes/getSettingKey.asp">

<!#include file="../includes/sessionFunctions.asp">

<!#include file="../includes/databaseFunctions.asp">

<!#include file="../includes/screenMessages.asp">

<!#include file="../includes/currencyFormat.asp">



<%

on error resume next



dim mySQL, connTemp, rsTemp



' get settings

pStoreFrontDemoMode =

getSettingKey("pStoreFrontDemoMode")

pCurrencySign = getSettingKey("pCurrencySign")

pDecimalSign = getSettingKey("pDecimalSign")

pCompany = getSettingKey("pCompany")



pAuctions = getSettingKey("pAuctions")

pAllowNewCustomer = getSettingKey("pAllowNewCustomer")

pNewsLetter = getSettingKey("pNewsLetter")

pStoreNews = getSettingKey("pStoreNews")

pSuppliersList = getSettingKey("pSuppliersList")

pRssFeedServer = getSettingKey("pRssFeedServer")



%>

<b><%=getMsg(10021,"despatch")%></b>

<br>

<%=getMsg(10024,"Enter despatch ...")%>





The despatchExec.asp Page

<%

' WebShop 3.0x Shopping Cart

' Developed using ASP

' August-2002

' Email(E-Mail address blocked: See forum rules) for further information

' (URL address blocked: See forum rules)

' Details: add e-mail to newsletter list

%>



<!--#include file="../includes/settings.asp"-->

<!--#include file="../includes/getSettingKey.asp"-->

<!--#include file="../includes/databaseFunctions.asp"-->

<!--#include file="../includes/stringFunctions.asp"-->

<!--#include file="../includes/miscFunctions.asp"-->

<!--#include file="../includes/screenMessages.asp"-->

<!--#include file="../includes/sendMail.asp"-->



<%



on error resume next



dim mySQL, connTemp, rsTemp, pEmail



' get settings



pStoreFrontDemoMode = getSettingKey("pStoreFrontDemoMode")

pCurrencySign = getSettingKey("pCurrencySign")

pDecimalSign = getSettingKey("pDecimalSign")

pCompany = getSettingKey("pCompany")



pEmailSender= getSettingKey("pEmailSender")

pEmailAdmin= getSettingKey("pEmailAdmin")

pSmtpServer= getSettingKey("pSmtpServer")

pEmailComponent= getSettingKey("pEmailComponent")

pDebugEmail= getSettingKey("pDebugEmail")

pGiftRandom= getSettingKey("pGiftRandom")

pPercentageToDiscount= getSettingKey("pPercentageToDiscount")

pStoreLocation = getSettingKey("pStoreLocation")



' form

pidOrder = lcase(getUserInput(request.form("idOrder"),50))

pProduct = lcase(getUserInput(request.form("product"),50))

pQuantity = lcase(getUserInput(request.form("quantity"),50))





pPriceToDiscount = 0



' insert despatch



mySQL="INSERT INTO despatch2 (idOrder, product, quantity ) VALUES ('"
&pidOrder& "', '" &pProduct& "', '" &pQuantity&
"')"



call updateDatabase(mySQL, rstemp, "despatchExec")



pBody=getMsg(10025,"Despatch confirmed...") &VBcrlf&
getMsg(311,"To opt-out click at:") & " (URL address blocked: See
forum rules)="&pEmail



response.redirect "redit_message.asp?message="&Server.Urlencode(getMsg(10025,"Despatch confirmed"))



call closeDb()

%>



Thank you for your help in advance..

Regards,

philip

View 2 Replies


ADVERTISEMENT

Problem With Select Into Querry

Jun 18, 2006

I have two database on same server. I want write a querry, witch qering the data from 1st database, than create a new table on the 2nd database.
But the in clause after the into clause permanently generate error.

Here is the query€™s little part:
Select €¦..
into Backup in €™Test.mdb€™ from €¦

I try wrote other ways
in €™Test€™
in €™dbo.Test€™
in dbo.Test
but none of them work

its only work, when i not want pass for the second database

How can i pass the result for the 2nd Database

View 11 Replies View Related

How To Make The SSMSE To Return Whole Records Without Any Close Query Form And Re-create Query Form Operation?

Dec 25, 2007

Hi,
I got a problem.
I installed Microsoft SQL Server Management Studio Express 2005 version.
And I created a Compact database.
I created an connection in SSMSE to connect the database and opened a query form.
then, i run the following sql:

Select * from Table1

It returned 3 records to me.
After that, I used program to insert record into this table.
Then i ran this sql again, it still show me 3 records.
I closed the query form, and re-created a new query form, then run the sql, it returned 4 records to me.

Why? It's very strange and difficult to operate, right?
Is there anyone know how to make the SSMSE to return whole records without any close query form and re-create query form operation?

Thanks a lot!

And Merry X'max!!!

View 4 Replies View Related

Select &#043;replace Querry Problem..

Dec 20, 2006

Hi.every one. I have a problem when I use this querry
select replace(Title,'.','')AS Title1, ID from tbl_Sim Where Title1 LIKE '%377%'

And here is my record
Title : 0988.613.775
ID : 2

and here is the error: Invalid column name 'Title1'.
Can any one show me how to run this querry, I want to TRIM the 'Title' before it can be compared with another condition
I am a beginner. Thanks alots!

View 2 Replies View Related

Use The Reference Column Name In The Same SELECT Querry

Sep 17, 2007

Hi,
I am writing the following querry.





Code Snippet

Select dbo.fn_EnGiftId(116) AS 'EnGiftId', dbo.fn_DeGiftId(''+ EnGiftId +'') AS 'DeGiftId'
But the above querry giving me the following error When i am executing the querry:




Code Snippet

Server: Msg 207, Level 16, State 3, Line 1
Invalid column name 'EnGiftId'.
The scenario is I have created two functions 1st is for encryption of GiftId and 2nd is for Decryption of the Encrypted Giftid.
But in the same select querry i want to use the name of column which i have given to the encrypted data in the selct querry i want to use that same column name in the decryption function uin the same querry.

When i am executing the below querry it gives me the required output. So Why not above querry.




Code Snippet

Select dbo.fn_EnGiftId(116) AS 'EnGiftId', dbo.fn_DeGiftId(''+ dbo.fn_EnGiftId(116) +'') AS 'DeGiftId'
i d't want to write the encryption function again and again. Is theer any way to avoid this.?????

View 5 Replies View Related

SQL 2000 Password Change Form...?!?

Jul 23, 2007

I am looking to create an ASP w/ functionality to change user's SQL password.  Many do not have access to EM or Query Analyzer and need a website to visit.  Has any had expirience w/ this prior?

View 19 Replies View Related

Where To Order The Table Values Displayed In A Web Form Object? In Sql Server Or In The Application?

Sep 10, 2004

Hi,

I have a table in my database with several car types, and the order I want for that table is:

Car_typeA_1
Car_typeA_2
Car_typeA_3
Car_typeA_4
Other_Cars_typeA
Car_typeB_1
Car_typeB_2
Car_typeB_3
Other_Cars_typeB
Car_typeC_1
Car_typeC_2
Car_typeC_3
Car_typeC_4
Car_typeC_5
Other_Cars_typeC
...


This table is more or less always the same, but from time to time I want to add a new car type, for instance; Car_typeA_5, but this new type must be located under the last register, in the example under ‘Other_Cars_typeC’. So, now the order is wrong, and when I want to display these car types to a web form object, the items will appear wrong ordered.

My question is: To order the values(items) correctly, Where I have to do it? In the web page (ASP.NET) code behind, or somewhere in SQL Server (for example in the Stored Procedure that passes the value to the application)? Or maybe in the same database table..?

Thank you,
Cesar

View 7 Replies View Related

Default Sort Order - Open Table - Select Without Order By

Mar 27, 2008

Hi!

I recently run into a senario when a procedure quiered a table without a order by clause. Luckily it retrived data in the prefered order.

The table returns the data in the same order in SQL Manager "Open Table"

So I started to wonder what deterimins the sort order when there is no order by clause ?

I researched this for a bit but found no straight answers. My table has no PK, but an identiy column.

Peace.

/P

View 5 Replies View Related

Does A User Have To Have SQL Server Installed In Order For Windows Form To Connect To SQL 2005 Express DB

Apr 23, 2008

Hello,

I am creating a windows application that is not going to be used in a controlled environment like a LAN or some other network, so I want to include a local database in the install of this app. Ideally, I would like to use SQL 2005 Express like you would MSDE or Access, but I am not sure if the user must have SQL Server installed on their machine in order for this to work and I don't have a machine without it to test on.

Any help on this is greatly appreciated.

Thanks,
Derek

View 1 Replies View Related

How To Change View Code Or Table Form Stored Procedure + -

Jun 1, 2008

need help with my problem
i have this view
this code change the value field "new_unit" evry month from 1 > 2 > 3 > 4
like this evry 4 month it return to 1 >2..........
------------------------------------------ for example

if i put
unit_date = 01/05/2008
and unit=1
than new_unit=1




Code Snippet

SELECT empID, ShiftType, unit_date, unit, ISNULL(NULLIF ((unit - DATEDIFF(mm, unit_date, '01/01/' + CONVERT(varchar, YEAR(GETDATE())))) % 4, 0), 4)

AS new_unit

FROM dbo.empList




my question is how to create a stored procedure that move forward (all the employee) the "new_unit" field
in +1 OR "unit_date" value MONTH +1


like create stored procedure name "plus" + so if i run this name stored procedure name "plus"

the stored procedure go to the viewor table and change the code view or table value

so i forward all the the "new_unit" or "unit_date" value IN one (change the cycle)+1

it doesn't matter if it change the "unit" value in the table "dbo.empList" or "unit_date" value

the important thing is that i can forward +1 or backward -1

evry time i run the stored procedure i get +1 (in the "new_unit")
and olso
create stored procedure name "minus" + so if i run this name stored procedure name "minus"
this stored procedure that move backward the the "unit" value in the table "dbo.empList" or "unit_date" value in -1

TABLE dbo.empList

empid ShiftType unit_date unit

----------------------------------------------------------------------------
11111 6 01/01/2008 1
2222 8 01/03/2008 4
3333 9 01/04/2008 3

TNX for the help

View 7 Replies View Related

Create User Form

Oct 7, 2007

hello there,

Can i create user forms for user to select options and then present them with data based on their selection.i want to be able to use check boxs and combo box.thanks in advance

cheers
zolf

View 1 Replies View Related

Create User Form

Oct 7, 2007

hello there,

Can i create user forms for user to select options and then present them with data based on their selection.i want to be able to use check boxs and combo box.thanks in advance

cheers
zolf

View 5 Replies View Related

Create Login Form(authenticate With Sql)

Nov 22, 2006

Hi all.

M trying to create a logon form
I had something in mind but i can work it out yet

When the user wants to login into the application the value of textbox must be compared with the datafield in the sql server.
And then i want a messagebox to show up.

I created a table in sql server with 2 fields in it , User and Password.

I hope anyone could help me tnx already

View 1 Replies View Related

Create Vb.net User Login Form

Jul 19, 2006

Hi all,

I made a Windows forms app using vb.net (VS2005) and SQL server 2005 Express Edition (to which I'm new). During the creation of the app I used windows authentication in the connection string. Now I want to secure the app, meaning I want the SQL Server database not to be accessed without a username/password. I guess the logical thing is to create a login form, providing the username and password so it can be used for connecting to the database. I thought this would be a standard (thus easy) thing to do, but no forum or article yet showed me a way to accomplish this in an understandable way. I also want to deploy this app using click once technology. I need to distribute this app on a cd/dvd.

If possible, can anyone give me a step by step scenario for this? Many thanks in advance

(ps: please let me know if this should be in another thread)

View 7 Replies View Related

How To Create A Report Include 2 Page Form

Dec 4, 2007



Hi.
Does anybody knows how to create a report inside include 2 page? per page has itself body & pagefooter. for example on Page 1 is PO on page 2 is this PO contract list.


Thanks

View 6 Replies View Related

Can Create Access Form Layout Based On Table From Sql?

Sep 25, 2006

Hi,

Can this be done? Please advise. Thanks.Is there any template available in sql for creating forms?

View 1 Replies View Related

Specify Order For Select Results, Order By: Help!

Nov 17, 2006

Lets say I have a table named [Leadership] and I want to select the field 'leadershipName' from the [Leadership] Table.

My query would look something like this:

Select leadershipName
From Leadership

Now, I would like to order the results of this query... but I don't want to simply order them by ASC or DESC. Instead, I need to order them as follows:

Executive Board Members, Delegates, Grievance Chairs, and Negotiators

My question: Can this be done through MS SQL or do I need to add a field to my [Leadership] table named 'leadershipImportance' or something as an integer to denote the level of importance of the position so that I can order on that value ASC or DESC?

Thanks,

Zoop

View 1 Replies View Related

Change Sort Order In 6.5

Aug 25, 1999

Hi,

Is there any way to change the sort order from case sensitive to case insensitive in SQL Server 6.5 without having to rebuild the master db and all users db's.

thanks in advance.

View 1 Replies View Related

Two Select Statements In SP Return No Value In Web Form (only)

Mar 29, 2008

Hello. I  a SP with 2 select statements. If the first returns no results it does the second select. This works fine if I test it on the sql server. But when I try it in a webform using a sqldatasource it only returns a result if the first Select returns rows. If not It is an empty set (where I know it should not be. It returned resultrs on the SQL server). This is the code:1 ALTER PROCEDURE [SPName]
2
3 @SearchFor varchar(150) -- search string to compare with
4
5 AS
6
7 SELECT p.UserName,
8
9 (Select ImageName from ProfileImages Where IsMainImage = 1 And ProfileID = p.ProfileID) as ImageName,
10
11 (SELECT COUNT(*) FROM auditions WHERE UserID = p.ProfileID) AS AuditionCount
12
13 FROM Profiles p WHERE UserName = @SearchFor
14
15 IF (@@ROWCOUNT = 0)
16
17 Begin
18
19 SELECT p.UserName,
20
21 (Select ImageName from ProfileImages Where IsMainImage = 1 And ProfileID = p.ProfileID) as ImageName,
22
23 (SELECT COUNT(*) FROM auditions WHERE UserID = p.ProfileID) AS AuditionCount,
24
25 DIFFERENCE(p.UserName, @SearchFor) as Similarity
26
27 FROM profiles p WHERE SOUNDEX(p.UserName) = SOUNDEX( @SearchFor )
28
29 ORDER BY Similarity
30
31 END
32
33 RETURN
Now If i change the SP to test it to the code below, it does work in  both the webform and on the sql server: 1 ALTER PROCEDURE [SPName]
2
3 @SearchFor varchar(150) -- search string to compare with
4
5 AS
6
7 DECLARE @RowCount int
8 SET @RowCount = 0
9
10 IF (@ROWCOUNT = 0)
11
12 Begin
13
14 SELECT p.UserName,
15
16 (Select ImageName from ProfileImages Where IsMainImage = 1 And ProfileID = p.ProfileID) as ImageName,
17
18 (SELECT COUNT(*) FROM auditions WHERE UserID = p.ProfileID) AS AuditionCount,
19
20 DIFFERENCE(p.UserName, @SearchFor) as Similarity
21
22 FROM profiles p WHERE SOUNDEX(p.UserName) = SOUNDEX( @SearchFor )
23
24 ORDER BY Similarity
25
26 END
27
28 RETURNOnce again, Everything works as it should (for both versions), if I am testing it directly on the SQL server. Can anyone Help me on this? I am stumped and cannot find any answers about this. 
 
 

View 3 Replies View Related

Select Form Table And Exclude Another

Mar 18, 2005

Hello,

I've a query wich with I select buildings form a table.
I've a second table with a few building I don't want in my select (exclude form select).
How can I make this?

Thx a lot.
Dom

PS: I'm a sql newbie...

View 2 Replies View Related

Select Form 1 Table And Insert Into Another

Jan 30, 2004

Can someone point me in the right direction or show me a sample that may assist me in the following.

Thanks,
-dw


I need to select some data from 1 table and insert it into another using a stored procedure.

I also would like to select data from table 1 and insert a new record into table 1 modifying a field with new data passed by parameter.

Is it something like:

parameters passed = @selectJobNumber, @newJobNumber


declare @DeliveryMethodIDint

SELECT
@DeliveryMethodID=DeliveryMethodID,
... etc - more fields

FROM
jobDeliveryAddress

WHERE
(JobNumber= @selectJobNumber)


INSERT INTO [jobDeliveryAddress]
(
[JobNumber],
[DeliveryMethodID],
... etc - more fields

)
VALUES
(
@newJobNumber,
@DeliveryMethodID,
... etc

)

View 2 Replies View Related

Select Form 1 Table And Insert Into Another

Jan 30, 2004

Can someone point me in the right direction or show me a sample that may assist me in the following.

Thanks,
-dw


I need to select some data from 1 table and insert it into another using a stored procedure.

I also would like to select data from table 1 and insert a new record into table 1 modifying a field with new data passed by parameter.

Is it something like:

parameters passed = @selectJobNumber, @newJobNumber


declare @DeliveryMethodIDint

SELECT
@DeliveryMethodID=DeliveryMethodID,
... etc - more fields

FROM
jobDeliveryAddress

WHERE
(JobNumber= @selectJobNumber)


INSERT INTO [jobDeliveryAddress]
(
[JobNumber],
[DeliveryMethodID],
... etc - more fields

)
VALUES
(
@newJobNumber,
@DeliveryMethodID,
... etc

)

View 6 Replies View Related

Change Of Sort Order After Installation

Oct 26, 2000

hi,
if I change the sort order after I install sql server, I have to rebuild the databases. the meaning of rebuilding the Databases is to create a complete database from scrach including tables, store procedures data. or what is the meaning of rebuilding the databases

Ahmed

View 2 Replies View Related

Where To Change Chara Set And Sort Order

Aug 17, 2000

I have just started with 7.0 and found that one of my enviornments is not the same as production. I am trying to change the Char. set and sort order(rebuild master). In 6.5, install the CD and just update the options. In 7.0, do I have to un-install to do this? I looked on the CD and the local directory and can not seem to find the options to update the master db?

Thanks in Advance,

View 2 Replies View Related

Can I Change The Sort Order Of A Database On Sql

Feb 5, 2007

Im new to sql server 2000 can i change the order in the database is it possible. If anybody help me how to do it that would be a great help.

Articles on various categories

View 2 Replies View Related

How To Change Column Order In Tables?

Apr 14, 2008

I'm using VBE 2008 and in the edit table schema box it doesn't allow reordering the columns. Any solutions?

View 1 Replies View Related

Dynamically Change Grouping Order

Jan 23, 2008



Hello everyone.

You may had this problem before and know how to do that or may be can suggest me with some ideas.
I am in a process of creating a report wich has 3 groups and the data at the moment grouped by Company - Product - Customer.
I want to be able to change grouping order and respectively the data in report , something like Product - Company - Customer or Customer - Product- Company. (just example)
Is that possible to do at all?
May I add some drag and drop functionality and integrate in my report ?

Any ideas will be most welcomed

Thanks in advance

View 6 Replies View Related

How To Form SQL Select Queries Using Drop Down Lists??

Nov 8, 2006

Hi
 Will somebody please explain how  to combine asp.net dropdown lists to write
a  SQL database select query. I am using VWdeveloper and C Sharp.
For example, say I have  3 dropdownlists on my  webpage  as below,
List 1, Cities, London, Rome,  Barcelona etc
List 2, Restaurants by  Type, Italian, chinese, Indian etc
List 3, Number of tables/ seats 10-20,  20- 40, 50  -100
I want someone to be able to  search for a restaurant by selecting  an  item from  each dropdownlist
such as, "Barcelona" "Italian" "50-100"
This search query would return all the Italian restaurants in Barcelona with  50-100  tables/seats.
I  would also like the select query to work even if one of the dropdownlists items  is not selected.
Hope  somebody can clear this up?
Also would sql injection attacks be a threat by doing it this way?
Thanks all
 
 
 

View 9 Replies View Related

Select Query Form Multiple Databases

Dec 14, 2007

How do I write an sql statement to link tables in two databases and query them? For example: SELECT db1.table1.field1, db2.table1.field1 FROM Table1 INNER JOIN db1.table1.field1 ON db2.table1.field1 = db1.table1.field1
 
Thanks

View 6 Replies View Related

Upgrade From SQL 7 To 2000(also Change Sort Order)

Jul 9, 2002

Hi,
We ae planning to upgrade SQL 7 to SQL 2000 curretly we have BInar sort order.We have to cahnge the sort order to Dictionary sort order in SQL 2000 as per the recomendation from application vendor.
What is the best way Ican do this? Can I cahnge the sort order at the time of upgrade without effecting the data?
Thanks in advance
Mohan

View 1 Replies View Related

How To Change The Order Of Rows In Datatable Randomly?

Mar 26, 2006

Hello!

I would like randomly change the order of the rows in my table. Is there any way to do that? I also have a question about random generator. Is it possible to get a repeatable sequence of random numbers between 1 and 10 in T-SQL? (for example 2,7,6,5,8,9,3,2,....each state with the same probability). But i need the same sequence every time i run my procedure. I know this is just a pseudo generator. I tried to use function rand([seed]) and change the seed value, but I got some strange results...(floor(rand([seed])*100))

Thanx for any idea,

Z.

View 4 Replies View Related

How To Select All Articles Form A Category Without An Article That Is Selected?

Jun 7, 2004

Hello,
i want to Select all articles form a category without an article that is selected.

Thanx a lot !

View 1 Replies View Related

T-SQL (SS2K8) :: Change Column Order In Dynamic Pivot?

Sep 17, 2014

I am creating dynamic pivot and my column order is as below

[2015-02],[2015-04] [Prior] ,[2014-08],[2014-11]

but i want to display as below:

[Prior],[2014-08],[2014-11],[2015-02],[2015-04]

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved