473,406 Members | 2,439 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

setting up a counter and incremented it within a SQL statement

I am looking to produce a query that will in addition to displaying the
data will generate a counter that will be incremented by one with each
row of the resultset. For example, my resultset would look like this

ABC,123,1
BCD,234,2
CDE,345,3

where the 3rd column is the incremented counter.
Anyone have any ideas on how to do this?

Many thanks,
Alan Atwood

Nov 13 '05 #1
5 7383
On 7 Jan 2005 12:48:18 -0800, "alan_atwood" <al*********@hotmail.com>
wrote:
I am looking to produce a query that will in addition to displaying the
data will generate a counter that will be incremented by one with each
row of the resultset. For example, my resultset would look like this

ABC,123,1
BCD,234,2
CDE,345,3

where the 3rd column is the incremented counter.
Anyone have any ideas on how to do this?


http://www.lebans.com/rownumber.htm

mike
Nov 13 '05 #2
Thanks Mike. Doesn't work; keep getting a "User-defined type not
defined" and the Visual Basic debugger highlights the following line:

Function Serialize(qryname As String, keyname As String, keyvalue) As
Long

I'm not a VB guy, so any help on this would be appreciated.

Thanks,
Alan

Mike Preston wrote:
On 7 Jan 2005 12:48:18 -0800, "alan_atwood" <al*********@hotmail.com>
wrote:
I am looking to produce a query that will in addition to displaying thedata will generate a counter that will be incremented by one with eachrow of the resultset. For example, my resultset would look like this
ABC,123,1
BCD,234,2
CDE,345,3

where the 3rd column is the incremented counter.
Anyone have any ideas on how to do this?


http://www.lebans.com/rownumber.htm

mike


Nov 13 '05 #3
On 8 Jan 2005 16:02:24 -0800, "alan_atwood" <al*********@hotmail.com>
wrote:
Thanks Mike. Doesn't work; keep getting a "User-defined type not
defined" and the Visual Basic debugger highlights the following line:

Function Serialize(qryname As String, keyname As String, keyvalue) As
Long

I'm not a VB guy, so any help on this would be appreciated.

If you installed the whole thing correctly, you would have error
handling. Did you download the rownumber.zip file? If so, what,
exactly, did you do with it?

mike
Thanks,
Alan

Mike Preston wrote:
On 7 Jan 2005 12:48:18 -0800, "alan_atwood" <al*********@hotmail.com>
wrote:
>I am looking to produce a query that will in addition to displayingthe >data will generate a counter that will be incremented by one witheach >row of the resultset. For example, my resultset would look likethis >
>ABC,123,1
>BCD,234,2
>CDE,345,3
>
>where the 3rd column is the incremented counter.
>Anyone have any ideas on how to do this?


http://www.lebans.com/rownumber.htm

mike


Nov 13 '05 #4
I exported the modules from your db and imported them into my db.

Alan

Mike Preston wrote:
On 8 Jan 2005 16:02:24 -0800, "alan_atwood" <al*********@hotmail.com>
wrote:
Thanks Mike. Doesn't work; keep getting a "User-defined type not
defined" and the Visual Basic debugger highlights the following line:
Function Serialize(qryname As String, keyname As String, keyvalue) AsLong

I'm not a VB guy, so any help on this would be appreciated.


If you installed the whole thing correctly, you would have error
handling. Did you download the rownumber.zip file? If so, what,
exactly, did you do with it?

mike
Thanks,
Alan

Mike Preston wrote:
On 7 Jan 2005 12:48:18 -0800, "alan_atwood" <al*********@hotmail.com> wrote:

>I am looking to produce a query that will in addition to
displayingthe
>data will generate a counter that will be incremented by one with

each
>row of the resultset. For example, my resultset would look like

this
>
>ABC,123,1
>BCD,234,2
>CDE,345,3
>
>where the 3rd column is the incremented counter.
>Anyone have any ideas on how to do this?

http://www.lebans.com/rownumber.htm

mike


Nov 13 '05 #5
On 10 Jan 2005 08:42:34 -0800, "alan_atwood" <al*********@hotmail.com>
wrote:
I exported the modules from your db and imported them into my db.
Would you mind bottom posting? It makes following a discussion quite
a bit easier.

After you imported the modules into your db (BTW, it isn't *my* db, it
is Stephen Lebans' db), what did you do with your query in an attempt
to get a counter column? Please post the SQL for the query that
doesn't work.

If you load just the Lebans' db and click on Queries and then Query1,
do you get a counter column?

mike

Mike Preston wrote:
On 8 Jan 2005 16:02:24 -0800, "alan_atwood" <al*********@hotmail.com>
wrote:
>Thanks Mike. Doesn't work; keep getting a "User-defined type not
>defined" and the Visual Basic debugger highlights the followingline: >
>Function Serialize(qryname As String, keyname As String, keyvalue)As >Long
>
>I'm not a VB guy, so any help on this would be appreciated.
>


If you installed the whole thing correctly, you would have error
handling. Did you download the rownumber.zip file? If so, what,
exactly, did you do with it?

mike
>Thanks,
>Alan
>
>Mike Preston wrote:
>> On 7 Jan 2005 12:48:18 -0800, "alan_atwood"<al*********@hotmail.com> >> wrote:
>>
>> >I am looking to produce a query that will in addition todisplaying >the
>> >data will generate a counter that will be incremented by one with
>each
>> >row of the resultset. For example, my resultset would look like
>this
>> >
>> >ABC,123,1
>> >BCD,234,2
>> >CDE,345,3
>> >
>> >where the 3rd column is the incremented counter.
>> >Anyone have any ideas on how to do this?
>>
>> http://www.lebans.com/rownumber.htm
>>
>> mike
>


Nov 13 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Tim Hussein | last post by:
Hi, this is my situation: I have a counter on my MAIN page. It is incremented by requesting a certain "picture" which is the output of a script. I can do this manually with: ...
5
by: Graham Mattingley | last post by:
Hello Group, I have been playing with this idea for a month or so, but never really got anywhere.... I want to make a remote counter image, the same as is found on mycounter.com, where people...
2
by: Mike Brearley | last post by:
I have a counter (alright one I found on asp101.com) that checks for a session variable to prevent the counter from incrmenting if a user refreshes the page or returns to the page during the same...
1
by: Ryan Hubbard | last post by:
I'm inserting a record into MySQL 4.0 using Visual Basic ADO. When using the AddNew and Update method I am unable to retrieve the value of a Auto incrment field (Yes I know I can MoveLast but this...
8
by: David McDivitt | last post by:
I need to set tabs on java generated pages. Pages have four sections: header, sidebar, body, and footer. The sidebar and body change dynamically. The tab key must go to anchors, fields, and buttons...
6
by: Who.Really.Really.Cares | last post by:
Hi! I guess this must be a FAQ but I'll give it a try. I've searched the web and usenet archive and found only negative answers. But most of them were dated like 3-4 years back. Hasn't anything...
1
by: Mark | last post by:
I know I've seen an example of this, but can't seem to find it (I thought it was in my copy of 'ASP.NET Uleashed?). I want to use session_start in my global.asaax file to update a hit counter...
1
by: jvn | last post by:
I am experiencing a particular problem with performance counters. I have created a set of classes, that uses System.Diagnostics.PerformanceCounter to increment custom performance counters (using...
30
by: Paul W Smith | last post by:
I have written a hit counter, which I believe counts the times my page is hit by a user for each unique session by the user. The relevant part of my code is below: If...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
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...
0
agi2029
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,...
0
isladogs
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.