473,587 Members | 2,487 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 "CurrentUse r" 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 4524
Does each engineer have there own network login?
If so, then you can trap the NT username using an API call.

"Henro V" <ma**********@h otmail.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 "CurrentUse r" 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**********@h otmail.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 "CurrentUse r" 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.t iscali.nl...
Henro,
How about using CurrentUser() ?

--
Hope this helps
Arno R
"Henro V" <ma**********@h otmail.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 "CurrentUse r" 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*****@tiscal i.co.uk> wrote in message
news:3f******** **@mk-nntp-2.news.uk.tisca li.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**********@h otmail.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 "CurrentUse r" 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
5402
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
6199
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 2000) hosts the stored procedures. The SQL datawarehouse is hosted on a third server (say Server C ,which is SQL Server 2000) and contains allof the...
0
2115
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" connectionString="Server=KLEO\SQLEXPRESS;Integrated Security=True;Database=C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\wizou.mdf" providerName="System.Data.SqlClient" />
2
10639
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" connectionString="Server=KLEO\SQLEXPRESS;Integrated Security=True;Database=C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\wizou.mdf" providerName="System.Data.SqlClient" />
1
2104
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 to run it, I get this error "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection..." Here is my code (they...
4
4390
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 string used by PostgreSQL system so that we could not create a table named "USER". Is that true? Thanks a lot, Emi Lu
2
1896
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 role are being passed to the connection object, otherwise it would surely give the name of the user who was being denied. Has anyone come up against...
8
3045
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 returns the profile name and not the login name. This company has the profile name "USER" generic to its profiles for some strange reason. It may be a...
2
1773
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 interface:buttons with add,delete,modified
0
7920
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7849
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7973
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6626
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5718
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
1
2358
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1454
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1189
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.