|
|
 |
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
>
> |
 |
|