Showing posts with label fact. Show all posts
Showing posts with label fact. Show all posts

Tuesday, March 20, 2012

Accessing 2 databases on the SQL server through ASP.net

Hi everyone,

First of all I'd like to say I'm new to the forums, and in fact new to ASP.net.

I've had a couple of applications running in VB.net for the last year or so that I now am looking to move on and into ASP.net (main reason is to do with implementation to remote sites in foreign countries).

I'm currently following through the "Working with data and ASP.net 2.0" walkthrough on this site, which I must say has been a great help.

I'll start with the background stuff firstSmile

I have my main database on an SQL server. I also have 2 other databases on there - Customer and Employee. The reason for these are that they are shared amongst my VB applications and I kept them as seperate databases so that one database is all that needs to be administered and maintained, and these changes are then seen on both apps (takes away redundant data as well).

In my main database, main table, is a field called CustomerID. This value relates to the CustomerID in the Customer table. In my VB app all I do is have the user select a customer name, and then the customer ID value is copied to the CustomerID field of my main table when inserting / updating a row. This is simply accomplished with 2 SQL connections and 2 dataAdapters. I also use 2 dataSets - one for Customer, one for WorkRequests (the main database)...

I use ComponentOne stuff so that my grid will show the CustomerName instead of the CustomerID etc, and the same applies when I use my Employee database - I run many dataAdapters to this for things such as Account Manager, Technologist, Creator, UpdatedBy etc etc.

Now, I'm new to VS 2005 - my apps were created in VS 2003 and .net 1.1. Can I easily re-create my apps in ASP.net? My primary goal at the moment is to make sure I can load a row, and display the "lookup" values instead of the "integer" value. As my tables are in seperate databases, I would like to know the best way of accomplishing this, if it is of course possible.

Help and advice much appriciated.

Kind Regards,

Luke

SQL supports 4-section object name, in?the?format?of?server.database.owner_name.object_name,?so?just?add?database?part?when?you?want?to?refer?to?object?in?other?database.?For?more?information,?please?refer?to:?Using Identifiers as Object Names|||

Thank you very much, you reminded me about that, I think I looked into it ages ago but then put it to the back of my mind.

To display my CustomerName field by linking to the CustomerID field I'm using;

SELECT npd_dwr.dbo.dwr.dwrnumber, npd_dwr.dbo.dwr.customerid, customerdb.dbo.customer.customername
FROM npd_dwr.dbo.dwr
INNER JOIN customerdb.dbo.customer ON npd_dwr.dbo.dwr.customerid = customerdb.dbo.customer.customerid

Thanks again,

Regards

Monday, March 19, 2012

Access with SQL [ADP?]

I would have thought an Access ADP would be the trick for what this many has
asked for.
The fact that nobody in this thread has even mentioned these ADPs is
somewhat troubling to me. Is this dead end stuff? When I first read about
ADP's, I thought, "Hey! I can leverage my existing knowledge of how to get
Access to get up and dance, and take advantage of the speed of SQL at the
same time" In the months (well year now) that I've been wanting to move to
this approach, I have heard less and less about ADPs.
Anyone have any input on ADPs, and why they might not be a good solution for
a client-serverh app like this?
-BrianDP
"James Goodman" <j a m e s@.norton-associates.co.u k> wrote in message
news:c08ddq$48t$1@.titan.btinternet.com...
> Is Access forming a front-end db for a SQL DB?
> Would it not be possible to utilise some kind of web site (ASP) or
similar.
> It will run much faster over a WAN.
> Or are you 'replicating' the SQL Server db to an AccessDB?
> You dont need MSDE to connect to a SQL Server DB. MSDE is the 'desktop'
> version of SQL Server.
>
>
> --
> Cheers,
> James Goodman MCSE, MCDBA
> http://www.angelfire.com/sports/f1pictures
>I'm in the final stages of converting an MDB to ADP. It is much faster, but
there are gotchas to work around. If you don't already know SQL Server, the
learning curve is even steeper.
Kevin Hill
President
3NF Consulting
www.3nf-inc.com/NewsGroups.htm
"dp" <nobody@.mrspam.com> wrote in message
news:Vxo3c.92640$C65.17470@.nwrddc01.gnilink.net...
> I would have thought an Access ADP would be the trick for what this many
has
> asked for.
> The fact that nobody in this thread has even mentioned these ADPs is
> somewhat troubling to me. Is this dead end stuff? When I first read
about
> ADP's, I thought, "Hey! I can leverage my existing knowledge of how to
get
> Access to get up and dance, and take advantage of the speed of SQL at the
> same time" In the months (well year now) that I've been wanting to move
to
> this approach, I have heard less and less about ADPs.
> Anyone have any input on ADPs, and why they might not be a good solution
for
> a client-serverh app like this?
> -BrianDP
>
> "James Goodman" <j a m e s@.norton-associates.co.u k> wrote in message
> news:c08ddq$48t$1@.titan.btinternet.com...
> similar.
>|||Well, I'm learning the curve. Data types are different, there are views,
and these crazy SP_MOFO_THIS. No, I'm excited about the power that SQL will
provide. I had one task - it was one screen that queried two tables HUGE
tables, > 1M recs each, and filtered out the information, sliced it and
diced it a certain way, then reported on it. The version I wrote as an MDB,
when you hit the "go" button, would take about 30 seconds. In the new ADP I
wrote, it takes 3 seconds.
This increase in speed is enough for me. I'll learn ADO, I'll learn to
store my procedures. I'll learn about views, and such.
What my real question though is, "Is microsoft planning on dropping this
'avenue' any time in the near future?" I don't mind learning a new
language, or new methods for an older language, what I DO mind, is learning
some new microsoft strategy that is only going to be "hot stuff" for about 5
months before they change the synatax, and start calling it something else -
like with DAO to ADO. Well, for whatever reason they had to go that
direction fine, I just want to know that if I sink my teeth into ADO, that
I'll be able to be comfortable there for a while (say 5 years or so) before
microsoft some along with the .NET and scoops me up into some new
handy-dandy record-handling language.
-Brian
"Kevin3NF" <KHill@.NopeIDontNeedNoSPAM3NF-inc.com> wrote in message
news:eIqA7vgBEHA.892@.TK2MSFTNGP09.phx.gbl...
> I'm in the final stages of converting an MDB to ADP. It is much faster,
but
> there are gotchas to work around. If you don't already know SQL Server,
the
> learning curve is even steeper.
> --
> Kevin Hill
> President
> 3NF Consulting
> www.3nf-inc.com/NewsGroups.htm
> "dp" <nobody@.mrspam.com> wrote in message
> news:Vxo3c.92640$C65.17470@.nwrddc01.gnilink.net...
> has
> about
> get
the
> to
> for
'desktop'
>|||You're too late. The latest fad is already ADO.NET which bears little
resembalance to ADO.
No need to wonder - you are guaranteed to be victimized by a new fads on a
regular basis.
"dp" <nobody@.mrspam.com> wrote in message
news:YHq3c.80899$6K.23711@.nwrddc02.gnilink.net...
> Well, I'm learning the curve. Data types are different, there are views,
> and these crazy SP_MOFO_THIS. No, I'm excited about the power that SQL
will
> provide. I had one task - it was one screen that queried two tables HUGE
> tables, > 1M recs each, and filtered out the information, sliced it and
> diced it a certain way, then reported on it. The version I wrote as an
MDB,
> when you hit the "go" button, would take about 30 seconds. In the new ADP
I
> wrote, it takes 3 seconds.
> This increase in speed is enough for me. I'll learn ADO, I'll learn to
> store my procedures. I'll learn about views, and such.
> What my real question though is, "Is microsoft planning on dropping this
> 'avenue' any time in the near future?" I don't mind learning a new
> language, or new methods for an older language, what I DO mind, is
learning
> some new microsoft strategy that is only going to be "hot stuff" for about
5
> months before they change the synatax, and start calling it something
else -
> like with DAO to ADO. Well, for whatever reason they had to go that
> direction fine, I just want to know that if I sink my teeth into ADO, that
> I'll be able to be comfortable there for a while (say 5 years or so)
before
> microsoft some along with the .NET and scoops me up into some new
> handy-dandy record-handling language.
> -Brian
>
> "Kevin3NF" <KHill@.NopeIDontNeedNoSPAM3NF-inc.com> wrote in message
> news:eIqA7vgBEHA.892@.TK2MSFTNGP09.phx.gbl...
> but
> the
many
to
> the
move
solution
> 'desktop'
>|||Will ADO as I know it, the connection string, etc, will that continue to
morph over time as well? Every time Microsoft releases a new version of
Access/SQL Server I'm going to have to go tweek my code? This doesn't seem
right. I mean, I realize people aren't (for the most part) out there still
programming in Cobol, and wondering why people are expecting them to move
on. I just want to know that Microsoft won't drop support for ADO in the
near future.
-Brian|||I expect it will continue to be supported for some time.
However it will continue to "morph". Morphing is not the problem.
There is a special place in DLL hell for users of Access - Jet - MDAC.
You stand a good chance of
1) do a forced upgrade
2) having such upgrade break your application
3) having data reliablity problems due to 1 and 2.
Unlike the SQL people, the Access - Jet - MDAC
people don't seem to understand that data is important.
"dp" <nobody@.mrspam.com> wrote in message
news:Jkj4c.6$F9.3@.nwrddc01.gnilink.net...
> Will ADO as I know it, the connection string, etc, will that continue to
> morph over time as well? Every time Microsoft releases a new version of
> Access/SQL Server I'm going to have to go tweek my code? This doesn't
seem
> right. I mean, I realize people aren't (for the most part) out there
still
> programming in Cobol, and wondering why people are expecting them to move
> on. I just want to know that Microsoft won't drop support for ADO in the
> near future.
> -Brian

Tuesday, March 6, 2012

access to data in the cube

Hi,

i'm currently building a cube which data has a level of access depending who the logged in user is in the windows authentication. My cube's fact table is actually a VIEW with this line of code:

SELECT a.serviceid AS [service code], a.agentid AS [agent code], a.timeid AS date, a.talktime AS [talk time], a.wraptime AS [wrap time]
FROM dbo.factAgentActivity AS a INNER JOIN
dbo.factaccess AS b ON a.agentid = b.agent AND b.username = SUSER_NAME()

I used SUSER_NAME to get the name of the user currently logged in and compared it against the username table. If i open this VIEW in the SQL SERVER database, i can retrieve the right data that user will see. But when I used this in the Analysis Services and Browse the cube, the metrics and cubes have blank values. The same thing if i link my cube to excel.

Is my setup correct or im missing something here?

thanks in advance!

regards,

cherriesh

I'm not sure to understand but:

"SUSER_NAME()" return the current user logged in.

It means that when you process the cube "SUSER_NAME()" is replaced with the AS account.

If it is correct, how can AS dynamically change the user on browser time?

Maybe I'm missing something.

Francesco

|||if you already know what access they should have, why wouldn't you just create a role(s) within your SSAS database project and assign the NT Users (or NT Groups) accordingly. Depending on your storage mode for your cube once you process the cube the view wouldn't work anyway, that would just be used to perform the initial load of the cube.