473,385 Members | 1,582 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,385 software developers and data experts.

Assigning query results to a variable

Hello,

I would like to Execute this Select Statement...

SELECT MAX(VisitorID) FROM Visitors.

Is there any way to store the result directly into a VB variable??

lngVisitorID = ???

Thanks!!!
Jul 19 '05 #1
2 4821
"SELECT MAX(VisitorID) AS MaxVisitorID FROM Visitors" then treat
MaxVisitorID as you would any other field in a recordset row ( like
"lngVisitorID = rs("MaxVisitorID") ).

Stephen Ghelerter

"Gordo" <gm****@yahoo.com> wrote in message
news:SU***********************@news2.calgary.shaw. ca...
Hello,

I would like to Execute this Select Statement...

SELECT MAX(VisitorID) FROM Visitors.

Is there any way to store the result directly into a VB variable??

lngVisitorID = ???

Thanks!!!

Jul 19 '05 #2
"SELECT MAX(VisitorID) AS MaxVisitorID FROM Visitors" then treat
MaxVisitorID as you would any other field in a recordset row ( like
"lngVisitorID = rs("MaxVisitorID") ).

Stephen Ghelerter

"Gordo" <gm****@yahoo.com> wrote in message
news:SU***********************@news2.calgary.shaw. ca...
Hello,

I would like to Execute this Select Statement...

SELECT MAX(VisitorID) FROM Visitors.

Is there any way to store the result directly into a VB variable??

lngVisitorID = ???

Thanks!!!

Jul 19 '05 #3

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

Similar topics

3
by: Mike Cocker | last post by:
Hello, I'm quite weak at PHP, so I was hoping to get some help understanding the below code. First off, I'm trying to create a "query form" that will allow me to display the results on my...
5
by: gtz669 | last post by:
I have a class which I am using for data stroage. I declare an instance of that class in my main class which is running my java applet. I Iassign it a value in the init () function and it works...
0
by: Gordo | last post by:
Hello, I would like to Execute this Select Statement... SELECT MAX(VisitorID) FROM Visitors. Is there any way to store the result directly into a VB variable?? lngVisitorID = ???
6
by: jjturon | last post by:
Can anyone help me?? I am trying to pass a Select Query variable to a table using Dlookup and return the value to same select query but to another field. Ex. SalesManID ...
20
by: weston | last post by:
I've got a piece of code where, for all the world, it looks like this fails in IE 6: hometab = document.getElementById('hometab'); but this succeeds: hometabemt =...
3
by: luis.c.torres | last post by:
Hello. I have and unbound form with a subform. The form has 4 controls (a combo, two txt boxes and a button). The combo has the filter criteria (Equal to, newer than, older than and between)...
25
by: Sourav | last post by:
Suppose I have a code like this, #include <stdio.h> int *p; void foo(int); int main(void){ foo(3); printf("%p %d\n",p,*p);
9
by: Kelii | last post by:
I've been trying to get this piece to work for a few hours, but have given up. I hope someone out there can help, I think the issue is relatively straightforward, but being a novice, I'm stumped....
2
by: milo1955 | last post by:
I have a form that passes a single variable via the GET function to a mysql databse query with the results paginated. The first page of the results work fine, but the link to the second page yields...
10
by: Lloyd Harold | last post by:
I'm very new to PHP and attempting to put together a simple script for retrieving MySQL data of personal records. The MySQL table I'm using consists of: 0: id 1: name 2: location (an integer...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.