473,441 Members | 2,076 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,441 software developers and data experts.

ADP and T-SQL Problem

I'm using Access 2002 and SQL 2000 on a stand alone computer and have
created an Access Project connecting to an existing SQL database.

All the tables and everything else in the SQL db is in the Access
project. My problem is that when I'm running functions my T-SQL
functions aren't working.

For instance if I have a line of code referring to the GetDate or
SUSER_SNAME functions in my module they don't return any values.

I tried creating test projects connecting to other dbs and I'm still
having the same problem.

So I was wondering what I have to do to get around this issue?

Nov 30 '05 #1
6 1685
Could you give us examples of these "lines of code"?

Nov 30 '05 #2
Here's an example:

strsql = "Select * From dbo.tblPlannedTasks Where [PlannedTaskID] = -1
AND PlannedTaskID IN " _
& "(SELECT dbo.tblPlannedTaskAssignees.PlannedTaskID FROM
dbo.tblPlannedTaskAssignees INNER JOIN " _
& "dbo.tblUsers ON dbo.tblPlannedTaskAssignees.UserID =
dbo.tblUsers.UserID " _
& "WHERE (dbo.tblUsers.LoginUserName = SUSER_SNAME()))"

The SUSER_SNAME function doesn't return a name.

Dec 1 '05 #3
I'm stumped.
Have you tested
SELECT SUSER_SNAME() AS Test
?

Dec 1 '05 #4
Br
Ecohouse wrote:
Here's an example:

strsql = "Select * From dbo.tblPlannedTasks Where [PlannedTaskID] = -1
AND PlannedTaskID IN " _
& "(SELECT dbo.tblPlannedTaskAssignees.PlannedTaskID FROM
dbo.tblPlannedTaskAssignees INNER JOIN " _
& "dbo.tblUsers ON dbo.tblPlannedTaskAssignees.UserID =
dbo.tblUsers.UserID " _
& "WHERE (dbo.tblUsers.LoginUserName = SUSER_SNAME()))"

The SUSER_SNAME function doesn't return a name.


Try using SYSTEM_USER instead?
--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response
Dec 1 '05 #5
I tried both of the above suggestions and neither one worked. This is
from a freeware version of software, so I assume that it must work
otherwise it wouldn't have been distributed.

So I still don't know what's going on with this. Any other ideas?

Dec 1 '05 #6
Thanks for all the help.

I thought that the SUSER_SNAME value would show up in a SQl string in
the immediate window. Once I copied the sql string into a view it
worked.

This was a program that was distributed free. I assumed that it was
working, but I guess not.
When I played around with the query I was able to get it to work.

Dec 1 '05 #7

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

Similar topics

2
by: Steve | last post by:
Hi; I have been writing a lot of short tsql scripts to fix a lot of tiny database issues. I was wondering if a could make an array of strings in tsql that I could process in a loop, something...
18
by: mountain man | last post by:
Greetings to all database professionals and laymen, Let us make a bold assumption that we have developed a software tool for the SQL Server environment which simply acts as an interface between...
2
by: dynoweb | last post by:
I have several *.sql files with schema/data changes to be applied to our current database. Is there a way to create a TSQL script that could be run from the SQL Query Analyzer that would...
1
by: Ernesto | last post by:
Using the "Pull New Subscription" wizrd in the enterprise manager, I can create a subscription without a problem. Howwever using TSQL I cannot do the same thing: Using this sequence:...
5
by: Ross27 | last post by:
Imagine a table in Microsoft Sql Server 2000 named Pictures with three fields. A primary key ID(int), a Name(nvarchar) and a Picture(image) field. Lets put some records into the table. The first...
7
by: Filips Benoit | last post by:
Dear all, Tables: COMPANY: COM_ID, COM_NAME, ..... PROPERTY: PRP_ID, PRP_NAME, PRP_DATATYPE_ID, PRP_DEFAULT_VALUE ( nvarchar) COMPANY_PROPERTY: CPROP_COM_ID, CPROP_PRP_ID, CPROP_VALUE...
0
by: kdilip41 | last post by:
Hi All, I would like to whether the following details is possible :: 1. 'How Many TSQL Statements Is Executed within a particular time frame say 8 hours and at the end of 8 hours i want a...
3
by: SQLJunkie | last post by:
Happy New Year everyone! I would like to capture CPU Utilization % using TSQL. I know this can be done using PerfMon but I would like to run TSQL command (maybe once every 5 minutes) and see...
8
by: Bill Gower | last post by:
I want to store an SQL string into a table and then be able to run it later. Here is the insert command "insert into ProjectSQL(ProjectID, SQLID, SQLString) values( " & locProjectID & ", " &...
0
by: dharper | last post by:
Hi! I'm new to sql 2005 and need to run an automated report that is a fairly simple fixed width ragged right report. Problem is I need a header in the report that has static text, plus the rowcount...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...
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
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

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.