473,671 Members | 2,341 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Pass Parameter into Table for From Clause

1 New Member
Hello, Here is the query I'm trying to run from a C# Windows Program for a Login Form.

SELECT CAST(DecryptByC ert(Cert_ID('Pa ssEncryption'), Password) AS NVARCHAR) AS Password, A.*
FROM Test, @Field1 AS A
WHERE Test.EmpID = @Field0

The @Field1 Parameter is the second table with permissions that will change depending on the program. Thus the need to pass it in as a parameter. When I run this I get an error saying "Must declare Table Variable @Field1". I pass in the parameters correctly using a Class I developed (The parameter @Field0 passed in for EmpID works correctly).

What do I need to do differently to be able to pass in a parameter to be used as a table?
Apr 11 '07 #1
0 920

Sign in to post your reply or Sign up for a free account.

Similar topics

6
5287
by: Ray | last post by:
Group, Passing inline values to a udf is straightforward. However, how or is it possible to pass a column from the select of one table into a udf that returns a table variable in a join to the original table. The goal is to explode the number of rows in the result set out based on the result of the udf. Although the example I am providing here is simplified, we are trying to parse out multiple values out of a text column and using a...
2
2434
by: Yarik | last post by:
Hello there! I am working with MS SQL Server 2000. I have a table function that takes an integer parameter and returns a table, and I can successfully use it like this (passing a literal as a parameter): SELECT * FROM MyTableFunction(1)
23
1833
by: Rob Oldfield | last post by:
Does anyone have any idea how to do this? I want to pass a select command a parameter and just use that as a LIKE/IN comparison with my SQL data. Thanks
3
9256
by: dk | last post by:
Hi all, Would appreciate some advice on the following: I am trying to speed up an Access database connected to a SQL Server back-end. I know I can use a pass-through query to pass the sql code directly to SQL Server and speed things up. However, I want to be able to "filter" or place conditions on which records to retrieve based on LOCAL tables in Access.
8
2610
by: Tcs | last post by:
I've been stumped on this for quite a while. I don't know if it's so simple that I just can't see it, or it's really possible. (Obviously, I HOPE it IS possible.) I'm trying to get my queries to run from VB. My pass-thru query retrieves data from our AS/400 that I use to build a local table (on my PC). My pass-thru and local do in fact work together when I run them interactively. But I want, no make that NEED, to run them from VB. ...
3
3607
by: Paul T. Rong | last post by:
I have a listbox (of product names) control on my form. I want to pass the selected item (a product name) to a subform, and the product unitprice should apear automatically next to the product name in the subform. Is it possible? How do I do this? Thanks in advance. Paul from Slovakia
0
3316
by: Zlatko Matiæ | last post by:
Hi everybody! Recently I was struggling with client/server issues in MS Access/PostgreSQL combination. Although Access is intuitive and easy to use desktop database solution, many problems appear when someone is trying to use it as front-end for real server database systems such as PostgreSQL or MySQL. One of these problems is regarding pass-through queries and parameters. I wanted to have all the code on client, while executing it on...
2
3174
by: Dean Slindee | last post by:
I would like to pass multiple parameters from a VB.NET application to an existing Access 2003 application's reports (essentially using Access as a report writer where the reports already exist). The reports' datasource is a stored procedure with multiple @parameters. This code works where the report requires no parameter: Dim strAccessDBPath As String Dim booReturn As Boolean = False strReportName = "rptCMOTeam1" strAccessDBPath =...
2
5743
by: jmarr02s | last post by:
I am creating a Pass Through Query. Here is my code: SELECT MDSDBA_CINTAKE.RECVDATE, MDSDBA_CINTAKE.CMPSRC, Count(MDSDBA_CINTAKE.CMPSRC) AS CountOfCMPSRC FROM MDSDBA_CINTAKE WHERE RECVDATE>=to_date( '01-09-2005','dd-mm-yyyy') AND RECVDATE<to_date( '01-10-2005','dd-mm-yyyy') AND CMPSRC IS NOT NULL GROUP BY CMPSRC;
0
8397
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8821
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8599
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8670
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7439
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6230
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5696
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4409
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2052
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.