Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 25th, 2006, 01:19 PM
Friend of Wrox
 
Join Date: May 2005
Posts: 189
Thanks: 0
Thanked 0 Times in 0 Posts
Default Overflow

Hei!

Why does my query give this error-message; Overflow?

Mvh grstad
__________________
Internet has become favorable with that tool...thank you Tim Berners-Lee!
 
Old November 25th, 2006, 04:23 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

What is your query?

Sounds like you're doing some kind mathematical calculation with an imcompatible data type.

Richard

 
Old November 25th, 2006, 04:43 PM
Friend of Wrox
 
Join Date: May 2005
Posts: 189
Thanks: 0
Thanked 0 Times in 0 Posts
Default

...my query goes like this;

strSQL1 = "SELECT * FROM Produkt P where P.ProduktNavn <> '" & navn & "' AND P.ProduktKjonn = '" & kjonn & "' AND Cint(P.ProduktFodt) >= '" & session("alder") & "' AND (P.ProduktHetro = '" & hetro & "') AND (P.ProduktHoyde = '" & en & "' OR P.ProduktHoyde = '" & bjarne & "' OR P.ProduktHoyde = '" & tre & "' OR P.ProduktHoyde = '" & fire & "' OR P.ProduktHoyde = '" & fem & "' OR P.ProduktHoyde = '" & seks & "' OR P.ProduktHoyde = '" & syv & "' OR P.ProduktHoyde = '" & atte & "' OR P.ProduktHoyde = '" & ni & "' OR P.ProduktHoyde = '" & ti & "' OR P.ProduktHoyde = '" & elleve & "' OR P.ProduktHoyde = '" & tolv & "') AND (P.Produktvekt = '" & tretten & "' OR P.ProduktVekt = '" & fjorten & "' OR P.ProduktVekt = '" & femten & "' OR P.ProduktVekt = '" & seksten & "' OR P.ProduktVekt = '" & sytten & "' OR P.ProduktVekt = '" & atten & "' OR P.ProduktVekt = '" & nitten & "' OR P.ProduktVekt = '" & tjue & "' OR P.ProduktVekt = '" & tjueen & "' OR P.ProduktVekt = '" & tjueto & "' OR P.ProduktVekt = '" & tjuetre & "' OR P.ProduktVekt = '" & tjuefire & "' OR P.ProduktVekt = '" & tjuefem & "' OR P.ProduktVekt = '" & tjueseks & "' OR P.ProduktVekt = '" & tjuesyv & "') AND (P.ProduktOye = '" & blaa & "' OR P.ProduktOye = '" & gronne & "' OR P.ProduktOye = '" & graa & "' OR P.ProduktOye = '" & sorte & "' OR P.ProduktOye = '" & brune & "' OR P.ProduktOye = '" & annet & "') AND (P.ProduktHaar = '" & lysblond & "' OR P.ProduktHaar = '" & blond & "' OR P.ProduktHaar = '" & morkblond & "' OR P.ProduktHaar = '" & lysbrunt & "' OR P.ProduktHaar = '" & brunt & "' OR P.ProduktHaar = '" & morkbrunt & "' OR P.ProduktHaar = '" & sort & "' OR P.ProduktHaar = '" & hvitt & "' OR P.ProduktHaar = '" & rodt & "' OR P.ProduktHaar = '" & graatt & "' OR P.ProduktHaar = '" & leif & "') AND (P.ProduktFylke = '" & akershus & "' OR P.ProduktFylke = '" & ostfold & "' OR P.ProduktFylke = '" & hedemark & "' OR P.ProduktFylke = '" & oppland & "' OR P.ProduktFylke = '" & oslo & "' OR P.ProduktFylke = '" & buskerud & "' OR P.ProduktFylke = '" & vestfold & "' OR P.ProduktFylke = '" & telemark & " ' OR P.ProduktFylke = '" & austagder & "' OR P.ProduktFylke = '" & vestagder & "' OR P.ProduktFylke = '" & rogaland & "' OR P.ProduktFylke = '" & hordaland & "' OR P.ProduktFylke = '" & sogn & "' OR P.ProduktFylke = '" & more & "' OR P.ProduktFylke = '" & sortrondelag & "' OR P.ProduktFylke = '" & nordtrondelag & "' OR P.ProduktFylke = '" & nordland & "' OR P.ProduktFylke = '" & troms & "' OR P.ProduktFylke = '" & svalbard & "' OR P.ProduktFylke = '" & finnmark & "')"

set ObjRs1 = Conn1.Execute(strSQL1)

        If not ObjRs1.EOF Then

            Do While not objRs1.eof

            response.Write "<b>" & objRs1("ProduktNavn") & "</b>" & ", som bor i " & ObjRs1("ProduktFylke") & " er en 10% match. " & "<a class=send href=maijl.asp>" & "" & "Send brev >>" & "" & "</a>" & "<br>"

            ObjRs1.MoveNext
        Loop %>



...and if you still are here, you might say it looks like a overfolw. I think it is 127 variables which I am trying to list out from the table.

Regards from grstad
 
Old November 26th, 2006, 03:58 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

OK

What exactly are you trying to do? Are you wanting to list out all of the distinct values/combinations of the variables in your Produkt table? If you already know how to use GROUP and/or DISTINCT you might want to try building your query with just one parameter in your WHERE statement and build it up.

First you can write the query to the page with Response.Write(strSQL1) which will show the query with your variables.

Then you can take that statement and put it into Query Analyzer and then just highlight the first part of the statement up until the first WHERE statement. Query Analyzer will only run what you have highlighted. Then you can see exactly where the query is failing.

I'm not sure I know what you mean when you say, "... list out from the table."

Thanks,
Richard

 
Old November 27th, 2006, 07:38 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 189
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hei!

What I am trying to do is this:

Let me say that Mr. Smith is logging into my web-sys. First he is registrating some values about himself. The values maight be; haircolor, hight and eyecolor. This values are inserted into the tbl Produkt.

Next, Mr. Smith is registrating some values which is his demands for a new partner like haircolor, hight and eyecolor. This values are inserted into the tbl Bestilling.

Then I have made Mr. Smits demands for a partner into a set of variables. The query trys to find a product in the tbl Produkt holding some of this variables! It maight be the next Mrs. Smith!

I have never used the query-builder. Is it a free software? And instead of the use of all the variables, is it now an arrow comes in use?

Tank you for spending time on this!

grstad
 
Old November 27th, 2006, 01:42 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

Hi G,

Query Analyzer comes with SQL, at least I know for sure it comes with SQL 2000. What you want to do is open your database up in Enterprise Manager. Then go to Tools>SQL Query Analyzer. QA should open with your database selected.

Response.Write your query to the page so you can get the variables that were assigned to the query. Copy and paste that into QA (Query Analyzer). Whatever you highlight in QA will run and only that will run. If you want the whole thing to run then don't highlight anything. To run the query or part of it you can click the little green arrow at the top of the page or press ALT + X to run it. Just keep selecting more and more of the query to run until you find out where the problem is.

Let me know how that goes.

Richard

 
Old November 27th, 2006, 01:48 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

First of all, you might want to provide us with the complete error message you are getting, and indicate which line of code is causing the error.

Next... it look to me that you are going to match on any one of the "demands", which means you most likely will retrieve everyone in the database - or at least everyone that meets the other criteria before your last AND clause.

I have no idea what the actual problem is, but I would suggest that you learn about using the IN predicate in your queries.

Woody Z http://www.learntoprogramnow.com
 
Old November 30th, 2006, 09:04 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 189
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hei rstelma!

I have not yet followed your directions. I will come back to it later, if it is ok. It seems that errors are showing up in a more random way. It is likely that my code is of the sphagetti-type!?
Time brings wisdom...

Woodyz, I will look up your url later. Thank you.

Mvh grstad
 
Old November 30th, 2006, 02:25 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

Hey G,

Whenever you get to it. Also, some of your problem may lie in your database design. I kind of have an idea of what you are doing. I'm not exactly sure. It looks like you could build this query dynamically if your database is set up right.

Lemme know.

Richard

 
Old December 8th, 2006, 03:00 PM
Friend of Wrox
 
Join Date: May 2005
Posts: 189
Thanks: 0
Thanked 0 Times in 0 Posts
Default

...Richard, yes my db-design are no good - either the querys. But now the "app" are working. The error-message Overflow occured due to handeling data-types; subtracting dates! I think...
Any url's on dynamic querys? Or how to design the db? (relations and third-normalized form)

Mvh
grstad





Similar Threads
Thread Thread Starter Forum Replies Last Post
ListBox - overflow possible? snufse ASP.NET 2.0 Basics 0 July 25th, 2008 09:50 AM
Overflow problems! Apocolypse2005 Beginning VB 6 2 September 4th, 2007 10:51 AM
regarding Overflow of variable hiruni Access VBA 4 February 27th, 2006 02:17 PM
Overflow Error mateenmohd Classic ASP Basics 4 July 5th, 2005 02:12 AM
Buffer Overflow rekha_jsr Oracle 3 February 3rd, 2005 08:11 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.