473,513 Members | 4,753 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to create a variable? (login as'"Currrent User")

I want the login name that somebody enters when starting the database to be
set as a variable.

I'll try to explain:

I have a table (Engineer) that lists engineers (they are the users)
The relevant fields are

Engineer.Name
Engineer.Code (where the login in the database is the Engineer.Code)

I have a table (Hours) that lists the hours that they worked
The relevant field here is

Hours.Name

I made a query on the table Hours that is called Hours Query
On the field
Hours Query.Engineer
I set the criterium
[Which engineer?]

What I want to do is create a variable "CurrentUser" that, instead of asking
to type in the engineer name fills the current user name in instead of
asking the question [Which Engineer?].

Can I do this and how?

TIA

Henro
Nov 12 '05 #1
4 4513
Does each engineer have there own network login?
If so, then you can trap the NT username using an API call.

"Henro V" <ma**********@hotmail.com> wrote in message
news:bp**********@news4.tilbu1.nb.home.nl...
I want the login name that somebody enters when starting the database to be set as a variable.

I'll try to explain:

I have a table (Engineer) that lists engineers (they are the users)
The relevant fields are

Engineer.Name
Engineer.Code (where the login in the database is the Engineer.Code)

I have a table (Hours) that lists the hours that they worked
The relevant field here is

Hours.Name

I made a query on the table Hours that is called Hours Query
On the field
Hours Query.Engineer
I set the criterium
[Which engineer?]

What I want to do is create a variable "CurrentUser" that, instead of asking to type in the engineer name fills the current user name in instead of
asking the question [Which Engineer?].

Can I do this and how?

TIA

Henro

Nov 12 '05 #2
Henro,
How about using CurrentUser() ?

--
Hope this helps
Arno R
"Henro V" <ma**********@hotmail.com> schreef in bericht news:bp**********@news4.tilbu1.nb.home.nl...
I want the login name that somebody enters when starting the database to be
set as a variable.

I'll try to explain:

I have a table (Engineer) that lists engineers (they are the users)
The relevant fields are

Engineer.Name
Engineer.Code (where the login in the database is the Engineer.Code)

I have a table (Hours) that lists the hours that they worked
The relevant field here is

Hours.Name

I made a query on the table Hours that is called Hours Query
On the field
Hours Query.Engineer
I set the criterium
[Which engineer?]

What I want to do is create a variable "CurrentUser" that, instead of asking
to type in the engineer name fills the current user name in instead of
asking the question [Which Engineer?].

Can I do this and how?

TIA

Henro

Nov 12 '05 #3
How can it be so simple!

That one does the trick!

Thnx a lot!

Henro

"Arno R" <ar****************@tiscali.nl> wrote in message
news:3f**********************@dreader2.news.tiscal i.nl...
Henro,
How about using CurrentUser() ?

--
Hope this helps
Arno R
"Henro V" <ma**********@hotmail.com> schreef in bericht

news:bp**********@news4.tilbu1.nb.home.nl...
I want the login name that somebody enters when starting the database to be set as a variable.

I'll try to explain:

I have a table (Engineer) that lists engineers (they are the users)
The relevant fields are

Engineer.Name
Engineer.Code (where the login in the database is the Engineer.Code)

I have a table (Hours) that lists the hours that they worked
The relevant field here is

Hours.Name

I made a query on the table Hours that is called Hours Query
On the field
Hours Query.Engineer
I set the criterium
[Which engineer?]

What I want to do is create a variable "CurrentUser" that, instead of asking to type in the engineer name fills the current user name in instead of
asking the question [Which Engineer?].

Can I do this and how?

TIA

Henro


Nov 12 '05 #4
That was the idea but I have already defined the engineers in the database
together with their network login codes so CurrentUser () does the trick!

Thnx for thinking anyway and I must say, you were thinking exactly along the
lines I was thinking.

Grtz Henro

"Nigel tombs" <ic*****@tiscali.co.uk> wrote in message
news:3f**********@mk-nntp-2.news.uk.tiscali.com...
Does each engineer have there own network login?
If so, then you can trap the NT username using an API call.

"Henro V" <ma**********@hotmail.com> wrote in message
news:bp**********@news4.tilbu1.nb.home.nl...
I want the login name that somebody enters when starting the database to

be
set as a variable.

I'll try to explain:

I have a table (Engineer) that lists engineers (they are the users)
The relevant fields are

Engineer.Name
Engineer.Code (where the login in the database is the Engineer.Code)

I have a table (Hours) that lists the hours that they worked
The relevant field here is

Hours.Name

I made a query on the table Hours that is called Hours Query
On the field
Hours Query.Engineer
I set the criterium
[Which engineer?]

What I want to do is create a variable "CurrentUser" that, instead of

asking
to type in the engineer name fills the current user name in instead of
asking the question [Which Engineer?].

Can I do this and how?

TIA

Henro


Nov 12 '05 #5

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

Similar topics

2
5394
by: Metior | last post by:
Hi, The error i get is as follows: Microsoft OLE DB Provider for ODBC Drivers error '80040e4d' Login failed for user 'webuser'.
1
6187
by: VC | last post by:
Hello, I have an issue here. Hope someone can help me. Issue: Developer is using a web application from one server (IIS) (say Server A). A second server (say Server B, which is SQL Server...
0
2088
by: Mr.KisS | last post by:
Hello. I'm under Windows XP PRO SP1, IIS 5.1 ans SQL SERVER 2005 Express. When i try to open a connexion with : <connectionStrings> <add name="AppCnxStr"...
2
10631
by: Mr.KisS | last post by:
Hello. I'm under Windows XP PRO SP1, IIS 5.1 ans SQL SERVER 2005 Express. When i try to open a connexion with : <connectionStrings> <add name="AppCnxStr"...
1
2101
by: fl | last post by:
I am running ASPNET on my local machine. I have a problem when I try to connect to a SQL server database table. The data looks good when I right click SqlDataAdapter1 to preview the data. When F5...
4
4377
by: Ying Lu | last post by:
Hello, I have a table named "USER" under MySQL database. When I am trying to move tables from MySQL to PostgreSQL, I found that I could not create a table namely "USER". I guess "USER" is a key...
2
1893
by: =?Utf-8?B?Y2FzaGRlc2ttYWM=?= | last post by:
I have a .NET 1.1 component trying to connect to a database but I keep getting the following message when the exception is thrown: @"Login failed for user '\'." It appears that no user and...
8
3039
MMcCarthy
by: MMcCarthy | last post by:
Hi everyone I had an interesting problem today with a client. I have set up security and privilege on a database depending on NT User Login. However, I've only just realised that the code...
2
1767
by: florina | last post by:
I must write a code for a hospital patiens with 5 interfaces. First interface: "Login button" 2 interface:"serach button" 3 interface:"reports" 4 interface :a menustrip with help and about 5...
0
7254
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
7153
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
7373
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,...
1
7094
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
7519
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
5677
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
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
796
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
452
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.