Freelancers Network
 
skill list top cap
Homepage
Join the Freelancer's Network
Update your details
Find a freelancer
Post a project
Find a project
Projects Archive
Post a job
Find a job
Jobs Archive
See Dan's Pages
See Andy's Pages
Link to this site
Resources
Join/Leave Forum
Forum Messages
+Additions+ Adverts
Advertising
Contact Us
Subscribe to our newsletter - enter your email address and hit return
Freelancers.net is owned and operated by Andy Stowell and Dan Winchester
skill list end cap
guru web hostcom

Find me again on Freelancers.net

RE: FN-FORUM: SQL ERROR - HELP REQUIRED PLEASE

date posted 8th January 2004 15:05

Bit of a stab in the dark since I don't claim to know VB related langs,
but try MAX - 1 ?

Often functions returning maximums count the number of items, which
sometime start from the 0th entry, hence -1.

Anyways worth a try :)

Ian

:: http://ianmoss.com :: http://alteris.co.uk :: http://rock666.com ::

>-----Original Message-----
>From: [EMAIL REMOVED] [EMAIL REMOVED] On Behalf
>Of PAMELA WHITTAKER
>Sent: 08 January 2004 15:38
>To: FN-FORUM / [EMAIL REMOVED]
>Subject: FN-FORUM: SQL ERROR - HELP REQUIRED PLEASE
>
>
>
>Hi,
>
>I am getting the following error
>
>
>
>"Exception Details: System.IndexOutOfRangeException: Maximum"
>
> the line I am getting it on is Return drFT("Maximum")
>
>Could some one tell me what I have dobe wrong please
>
>
>
>Thanks
>
>Pam
>
>
>
>
>The .net function is
>
>
>
>Private Function _MaxBasketID() As Integer
>
>Dim connFT As New OleDbConnection(_ConnectionString)
>
>Dim cmdFT As New OleDbCommand
>
>cmdFT.Connection = connFT
>
>cmdFT.CommandType = CommandType.Text
>
>connFT.Open()
>
>cmdFT.CommandText = "SELECT 'Maximum' =
>MAX(tblOrder.orderBasketID) FROM tblOrder;"
>
>Dim drFT As OleDbDataReader
>
>drFT = cmdFT.ExecuteReader
>
>If drFT.Read Then
>
>Return drFT("Maximum")
>
>End If
>
>drFT.Close()
>
>connFT.Close()
>
>End Function
>
>
>--
>** Get all the Freelance Work you Can Handle *
>The Web Design Business Kit will show you proven tactics
>and strategies for marketing your business, winning bids,
>managing projects and pricing your work. Free Shipping
>Worldwide. Read more & get free chapters at:
>http://www.sitepoint.com/launch/b7c91e/3/4
>
>To advertise here:
>http://www.freelancers.net/advertising.html
>
>



Messages by Day
January 31st 2004
January 30th 2004
January 29th 2004
January 28th 2004
January 27th 2004
January 26th 2004
January 25th 2004
January 24th 2004
January 23rd 2004
January 22nd 2004
January 21st 2004
January 20th 2004
January 19th 2004
January 18th 2004
January 17th 2004
January 16th 2004
January 15th 2004
January 14th 2004
January 13th 2004
January 12th 2004
January 11th 2004
January 10th 2004
January 9th 2004
January 8th 2004
January 7th 2004
January 6th 2004
January 5th 2004
January 4th 2004
January 3rd 2004
January 2nd 2004
January 1st 2004


Messages by Month
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004


Messages by Year
2008
2007
2006
2005
2004
2003
2002
2001
2000