Showing posts with label odbc. Show all posts
Showing posts with label odbc. Show all posts

Sunday, March 11, 2012

Cascading Parameter with ODBC , visula studio 2005

Hi Friends,

I have 2 parameter One is Office (Listbox) another Account(list box) , where Account list box filling is dependent on the Office selection.

In published report when I select the office from list box the page got refreshed but it not updating the account list, the account list box looks diabled?

I have define the two parameter and for the second parameter here is the query

="SELECT ACCOUNT_ID, ACCOUNT_NUMBER FROM MLGDB2.A_ACCOUNT " &
"where OFFICE_ID =" & Parameters!paramOffice.Value &
"ORDER BY ACCOUNT_ID "

To access parameter i need to use Parameters!paramOffice.Value with ODBC driver instead of @.param.

Can any one help me.

Thanks

Novin

Hi Novin,

This is something that I have done many of times. I will try and explain how to do this correctly.

1. Make a data set with your Office list

2. Make a second data set with a select statement like:

SELECT

ACCOUNT_ID,

ACCOUNT_NUMBER

FROM MLGDB2.A_ACCOUNT
WHERE OFFICE_ID in (@.Office.Value)


ORDER BY ACCOUNT_ID
3. Make sure you add a parameter to the second data set called @.Office on the parameter tab in the data set.

4. Now go to your report parameters and create two parameters. The first one is @.Office and the second one is @.Account.

5. Make sure you have the correct order Office, then Account

6. Set @.Office data set to your Office data set.

7. Set @.Account parameter to the Account dataset. Make sure to select a default value from query.

This will allow you to have a dependent parameter. Once you select the values in Office then the default will kick out the values for Account.

The way in which you explained the orginal message I am not sure will ever work

|||

Hi Thanks for your valuable reply.

I m using MS visual studio 2005, It seems like it is not supporting variablethe @.param syntext,

How to implement parameter cascading in visula studio 2005?

I found on cascading parameter implementation on MSDN for Server Business Intelligence Development Studio not for visula studio 2005.

http://msdn2.microsoft.com/en-us/library/aa337426.aspx

Thanks

Novin.

|||

Hi

The implementation is working it was a silly mistake from my side i have assign wrong data type the the paremeter.

Thanks,

Novin

Cascading Parameter with ODBC

Hi Friends,

I have 2 parameter One is Office (Listbox) another Account(list box) , where Account list box filling is dependent on the Office selection.

In published report when I select the office from list box the page got refreshed but it not updating the account list, the account list box looks diabled?

I have define the two parameter and for the second parameter here is the query

="SELECT ACCOUNT_ID, ACCOUNT_NUMBER FROM MLGDB2.A_ACCOUNT " &
"where OFFICE_ID =" & Parameters!paramOffice.Value &
"ORDER BY ACCOUNT_ID "

To access parameter i need to use Parameters!paramOffice.Value with ODBC driver instead of @.param.

Can any one help me.

Thanks

Novin

Hi Novin,

This is something that I have done many of times. I will try and explain how to do this correctly.

1. Make a data set with your Office list

2. Make a second data set with a select statement like:

SELECT

ACCOUNT_ID,

ACCOUNT_NUMBER

FROM MLGDB2.A_ACCOUNT
WHERE OFFICE_ID in (@.Office.Value)


ORDER BY ACCOUNT_ID
3. Make sure you add a parameter to the second data set called @.Office on the parameter tab in the data set.

4. Now go to your report parameters and create two parameters. The first one is @.Office and the second one is @.Account.

5. Make sure you have the correct order Office, then Account

6. Set @.Office data set to your Office data set.

7. Set @.Account parameter to the Account dataset. Make sure to select a default value from query.

This will allow you to have a dependent parameter. Once you select the values in Office then the default will kick out the values for Account.

The way in which you explained the orginal message I am not sure will ever work

|||

Hi Thanks for your valuable reply.

I m using MS visual studio 2005, It seems like it is not supporting variablethe @.param syntext,

How to implement parameter cascading in visula studio 2005?

I found on cascading parameter implementation on MSDN for Server Business Intelligence Development Studio not for visula studio 2005.

http://msdn2.microsoft.com/en-us/library/aa337426.aspx

Thanks

Novin.

|||

Hi

The implementation is working it was a silly mistake from my side i have assign wrong data type the the paremeter.

Thanks,

Novin

Saturday, February 25, 2012

Capturing ODBC user name at runtime

Hi:
We are using SRS to report from a DB2 database running on AS400's. It is
working very well.
Pushing ahead, we want to capture information on when certain reports
(actually letters) are generated. The reports prompt for login credentials
at run time. These DB2 database credentials are passed to the database
server and the report returns the data just fine. Works great right out of
the box.
What we would like to do is capture the user name that is passed to the
database. This is not the Windows AD username that can be obtained by the
global field
User!UserID, but the DB2 specific user name that is passed by the ODBC
connection.
Can this be captured at runtime? We have reviewed the RS object model and
haven't found what we are looking for. Are we barking up the wrong tree?
Thanks in advance.
Bruce.
swgAre the credentials parameters?
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"bwschiek@.hotmail.com" <bwschiekhotmailcom@.discussions.microsoft.com> wrote
in message news:CC286D82-B3E9-48F4-AD5A-ACAB49A19C8B@.microsoft.com...
> Hi:
> We are using SRS to report from a DB2 database running on AS400's. It is
> working very well.
> Pushing ahead, we want to capture information on when certain reports
> (actually letters) are generated. The reports prompt for login
> credentials
> at run time. These DB2 database credentials are passed to the database
> server and the report returns the data just fine. Works great right out
> of
> the box.
> What we would like to do is capture the user name that is passed to the
> database. This is not the Windows AD username that can be obtained by the
> global field
> User!UserID, but the DB2 specific user name that is passed by the ODBC
> connection.
> Can this be captured at runtime? We have reviewed the RS object model and
> haven't found what we are looking for. Are we barking up the wrong tree?
> Thanks in advance.
> Bruce.
> swg|||Hi:
They are not parameters in the sense that they are built into the report as
parameters.
Instead of saving credentials securely on the report server, I selected the
"The credentials supplied by the user running the report." under the "Connect
Using:" portion of the datasource Properties page.
It is that username that the user enters at runtime that I need to capture.
Thanks.
Bruce.
"Bruce L-C [MVP]" wrote:
> Are the credentials parameters?
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "bwschiek@.hotmail.com" <bwschiekhotmailcom@.discussions.microsoft.com> wrote
> in message news:CC286D82-B3E9-48F4-AD5A-ACAB49A19C8B@.microsoft.com...
> > Hi:
> >
> > We are using SRS to report from a DB2 database running on AS400's. It is
> > working very well.
> >
> > Pushing ahead, we want to capture information on when certain reports
> > (actually letters) are generated. The reports prompt for login
> > credentials
> > at run time. These DB2 database credentials are passed to the database
> > server and the report returns the data just fine. Works great right out
> > of
> > the box.
> >
> > What we would like to do is capture the user name that is passed to the
> > database. This is not the Windows AD username that can be obtained by the
> > global field
> > User!UserID, but the DB2 specific user name that is passed by the ODBC
> > connection.
> >
> > Can this be captured at runtime? We have reviewed the RS object model and
> > haven't found what we are looking for. Are we barking up the wrong tree?
> >
> > Thanks in advance.
> >
> > Bruce.
> >
> > swg
>
>|||Oh, I see. Sorry. I am not aware of a way to get this via built in
functionality but how about this. It depends on your database but SQL Server
has a function that returns the user:
SELECT 'The current user is: '+ convert(char(30), CURRENT_USER)
If your database has something similar then have a second dataset that uses
the same data source and get the information that way.-- Bruce Loehle-Conger
MVP SQL Server Reporting Services
"bwschiek@.hotmail.com" <bwschiekhotmailcom@.discussions.microsoft.com> wrote
in message news:FB08FB96-06B5-4E39-A9DA-4929CFC3629E@.microsoft.com...
> Hi:
> They are not parameters in the sense that they are built into the report
> as
> parameters.
> Instead of saving credentials securely on the report server, I selected
> the
> "The credentials supplied by the user running the report." under the
> "Connect
> Using:" portion of the datasource Properties page.
> It is that username that the user enters at runtime that I need to
> capture.
> Thanks.
> Bruce.
> "Bruce L-C [MVP]" wrote:
>> Are the credentials parameters?
>>
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>> "bwschiek@.hotmail.com" <bwschiekhotmailcom@.discussions.microsoft.com>
>> wrote
>> in message news:CC286D82-B3E9-48F4-AD5A-ACAB49A19C8B@.microsoft.com...
>> > Hi:
>> >
>> > We are using SRS to report from a DB2 database running on AS400's. It
>> > is
>> > working very well.
>> >
>> > Pushing ahead, we want to capture information on when certain reports
>> > (actually letters) are generated. The reports prompt for login
>> > credentials
>> > at run time. These DB2 database credentials are passed to the database
>> > server and the report returns the data just fine. Works great right
>> > out
>> > of
>> > the box.
>> >
>> > What we would like to do is capture the user name that is passed to the
>> > database. This is not the Windows AD username that can be obtained by
>> > the
>> > global field
>> > User!UserID, but the DB2 specific user name that is passed by the ODBC
>> > connection.
>> >
>> > Can this be captured at runtime? We have reviewed the RS object model
>> > and
>> > haven't found what we are looking for. Are we barking up the wrong
>> > tree?
>> >
>> > Thanks in advance.
>> >
>> > Bruce.
>> >
>> > swg
>>

Friday, February 10, 2012

Cant unlock records in SQL Server

I have an Access97 front end using ODBC to communicate with an
SQLServer 7.0 back end on a different machine. Most of the work I do
in the front end uses forms bound to linked tables that reside on the
back end. In one instance though I have to create some new records
programmatically and I use code in a procedure in a general module in
the front end that looks like this:

Set newrec = db.OpenRecordset("SELECT * FROM [workshop assignments]",
dbOpenDynaset, dbAppendOnly + dbSeeChanges)
newrec.AddNew ' assign the workshop
newrec![ComboWS] = WSKey
newrec![Participant] = IndividualID
newrec![Assigned] = True
newrec.Update
newrec.Close

The problem occurs later when I am in a form that views those records
that were just added. For some reason SQLServer still has those
records locked, and I am not allowed to make any changes to them. I
can't even just delete them. In fact, even when I exit out of all my
forms, go straight into the table window, straight to the table itself
(but still in the front end), I cannot delete or change those records
directly. I've tried taking down the front end and bringing it back
up. I've tried restarting the whole computer where the front end
resides. I've also tried restarting the SQL Server. I still can't
change those records. Oddly enough, I can change the records within
SQL Server itself. The Access97 front end will see the new values, but
still is unable to do anything with them. How can I fix this problem?
Thank you for any help you can give me,
Rebecca JaxonOK, we've solved it. Sorry to bother you all. The problem was that I
had some other boolean fields I was just ignoring. It used to work
fine when the back end was still in Access97. Apparently, when
Access97 sees a null in a boolean field it just assumes that it means
false, but when SQL Server sees such a thing, it causes this problem.
I was not filling in all the false values, and hadn't set the default
to false. Now I know.

Rebecca