|
I have a query that is as follows:
select * from contact c, contact_emails ce where ce.email = 'EMAIL' and c.password = 'PASSWORD' and ce.contact_id = c.id.
The query works but for what I need to do, I need the table names to be displayed in the header information.
Right now the header looks like this:
| id | first | last | password | id | email |
What I need is so that is looks like this:
| c.id | c.first | c.last | c.password | ce.id | ce.email |
I need to accomplish this by using the wildcard * (In other words the query cannot change).
Any ideas???
|
|
|
|
|
Can't be done, AFAIK.
If you can say a little more about:
1) what you are using the query for
2) what you are trying to accomplish
someone might be able to suggest a work-around.
Bill
|
|
|
|
|
I think the title says it all...oh except in VB.NET
Thanks in advance
David
|
|
|
|
|
Hi
I am a .net programmer writing database codes.
my qestion is:
Every time I do a project I should go to customer's office and install SQL Server on his computer , because my codes uses "sql server" as DBMS.
now...
CAN You help me to do something to avoid this?
for example a way to packaging sql server engine in my program install package?
regards
|
|
|
|
|
You can package MSDE, but I'll bet it's not legal to do it with SQL-Server as your clients needs licenses for it.
You can do it with MSDE, and just make it install in silent mode, using it's commandline switches.
- Anders
Money talks, but all mine ever says is "Goodbye!"
ShotKeeper, my Photo Album / Organizer Application[^]
My Photos[^]
New developersite: RealDevs.Net
|
|
|
|
|
Well, I'd still consider myself a newbie here. I was hoping someone would be
able to rewrite the following monster to be more efficient.
Thank You and Good Luck!
CREATE PROCEDURE usp_Calls
@SexID char,
@RaceID char,
@LBirth datetime,
@UBirth datetime,
@SiteID varchar(5),
@DD datetime,
@CallActivity datetime
AS
declare @CAct table (CallStamp datetime, TesterID char(7), StudyNo char(15), QueStatusID varchar(2))
declare @CallFT table (CallFrom datetime, CallTo datetime, TesterID char(7))
insert @CAct
select distinct tResultQue.CallStamp, tResultQue.TesterID, tResultQue.StudyNo, tResultQue.QueStatusID
from tResultQue
where tResultQue.CallStamp >= @CallActivity
insert @CallFT
select distinct tTesterContactInfo.ContactBestFrom as CallFrom, tTesterContactInfo.ContactBestTo as CallTo, tTesterContactInfo.TesterID
from tTesterContactInfo
IF @SexID = '*' AND @RaceID = '*' AND @SiteID <> '90000'
BEGIN SELECT distinct datediff(dd, getdate(), tGroup.ScheduleStamp) * -1 as DaysPast, tResultQue.TesterID, tTester.LastName, tTester.FirstName, tTester.WorkNo, tTester.WorkExtension as WorkExt, tTester.HomeNo, tTester.SexID as Sex, tTester.Birth, tTester.RaceID as Race, Poof.CallStamp as CallActivity, Poof.StudyNo as StudyActivity, Poof.QueStatusID as Status,TCall.CallFrom, TCall.CallTo
FROM tGroup INNER JOIN tResultQue ON (tGroup.GroupID = tResultQue.GroupID) INNER JOIN tTester ON (tResultQue.TesterID = tTester.TesterID) left join @CAct as Poof on (Poof.TesterID = tTester.TesterID) left join @CallFT as TCall on (TCall.TesterID = tTester.TesterID)
WHERE tTester.Birth >= @LBirth AND tTester.Birth <= @UBirth AND tTester.SiteID = @SiteID AND tGroup.ScheduleStamp <= @DD AND tTester.TesterID NOT IN
(SELECT distinct tTester.TesterID
FROM tTester INNER JOIN tResultQue ON (tTester.TesterID = tResultQue.TesterID) INNER JOIN tGroup ON (tResultQue.GroupID = tGroup.GroupID)
WHERE tGroup.ScheduleStamp > @DD
GROUP BY tTester.TesterID) AND
tGroup.ScheduleStamp = (SELECT MAX(cor_tGroup.ScheduleStamp)
FROM tTester cor_tTester INNER JOIN tResultQue cor_tResultQue ON (cor_tTester.TesterID = cor_tResultQue.TesterID) INNER JOIN tGroup cor_tGroup ON (cor_tResultQue.GroupID = cor_tGroup.GroupID)
WHERE cor_tTester.TesterID = tTester.TesterID)
and
tResultQue.CallStamp = (SELECT MAX(cor_tResultQue.CallStamp)
FROM tTester cor_tTester INNER JOIN tResultQue cor_tResultQue ON (cor_tTester.TesterID = cor_tResultQue.TesterID) INNER JOIN tGroup cor_tGroup ON (cor_tResultQue.GroupID = cor_tGroup.GroupID)
WHERE cor_tTester.TesterID = tTester.TesterID)
order by tTester.LastName
END
IF @SexID = '*' AND @RaceID = '*' AND @SiteID = '90000'
BEGIN SELECT distinct datediff(dd, getdate(), tGroup.ScheduleStamp) * -1 as DaysPast, tResultQue.TesterID, tTester.LastName, tTester.FirstName, tTester.WorkNo, tTester.WorkExtension as WorkExt, tTester.HomeNo, tTester.SexID as Sex, tTester.Birth, tTester.RaceID as Race, Poof.CallStamp as CallActivity, Poof.StudyNo as StudyActivity, Poof.QueStatusID as Status, TCall.CallFrom, TCall.CallTo
FROM tGroup INNER JOIN tResultQue ON (tGroup.GroupID = tResultQue.GroupID) INNER JOIN tTester ON (tResultQue.TesterID = tTester.TesterID) left join @CAct as Poof on (Poof.TesterID = tTester.TesterID) left join @CallFT as TCall on (TCall.TesterID = tTester.TesterID)
WHERE tTester.Birth >= @LBirth AND tTester.Birth <= @UBirth AND tGroup.ScheduleStamp <= @DD AND tTester.TesterID NOT IN
(SELECT distinct tTester.TesterID
FROM tTester INNER JOIN tResultQue ON (tTester.TesterID = tResultQue.TesterID) INNER JOIN tGroup ON (tResultQue.GroupID = tGroup.GroupID)
WHERE tGroup.ScheduleStamp > @DD
GROUP BY tTester.TesterID)
AND
tGroup.ScheduleStamp = (SELECT MAX(cor_tGroup.ScheduleStamp)
FROM tTester cor_tTester INNER JOIN tResultQue cor_tResultQue ON (cor_tTester.TesterID = cor_tResultQue.TesterID) INNER JOIN tGroup cor_tGroup ON (cor_tResultQue.GroupID = cor_tGroup.GroupID)
WHERE cor_tTester.TesterID = tTester.TesterID)
and
tResultQue.CallStamp = (SELECT MAX(cor_tResultQue.CallStamp)
FROM tTester cor_tTester INNER JOIN tResultQue cor_tResultQue ON (cor_tTester.TesterID = cor_tResultQue.TesterID) INNER JOIN tGroup cor_tGroup ON (cor_tResultQue.GroupID = cor_tGroup.GroupID)
WHERE cor_tTester.TesterID = tTester.TesterID)
order by tTester.LastName
END
IF @SexID <> '*' AND @RaceID = '*' AND @SiteID <> '90000'
BEGIN SELECT distinct datediff(dd, getdate(), tGroup.ScheduleStamp) * -1 as DaysPast, tResultQue.TesterID, tTester.LastName, tTester.FirstName, tTester.WorkNo, tTester.WorkExtension as WorkExt, tTester.HomeNo, tTester.SexID as Sex, tTester.Birth, tTester.RaceID as Race, Poof.CallStamp as CallActivity, Poof.StudyNo as StudyActivity, Poof.QueStatusID as Status, TCall.CallFrom, TCall.CallTo
FROM tGroup INNER JOIN tResultQue ON (tGroup.GroupID = tResultQue.GroupID) INNER JOIN tTester ON (tResultQue.TesterID = tTester.TesterID) left join @CAct as Poof on (Poof.TesterID = tTester.TesterID) left join @CallFT as TCall on (TCall.TesterID = tTester.TesterID)
WHERE tTester.SexID = @SexID AND tTester.Birth >= @LBirth AND tTester.Birth <= @UBirth AND tTester.SiteID = @SiteID AND tGroup.ScheduleStamp <= @DD AND tTester.TesterID NOT IN
(SELECT distinct tTester.TesterID
FROM tTester INNER JOIN tResultQue ON (tTester.TesterID = tResultQue.TesterID) INNER JOIN tGroup ON (tResultQue.GroupID = tGroup.GroupID)
WHERE tGroup.ScheduleStamp > @DD
GROUP BY tTester.TesterID)
AND
tGroup.ScheduleStamp = (SELECT MAX(cor_tGroup.ScheduleStamp)
FROM tTester cor_tTester INNER JOIN tResultQue cor_tResultQue ON (cor_tTester.TesterID = cor_tResultQue.TesterID) INNER JOIN tGroup cor_tGroup ON (cor_tResultQue.GroupID = cor_tGroup.GroupID)
WHERE cor_tTester.TesterID = tTester.TesterID)
and
tResultQue.CallStamp = (SELECT MAX(cor_tResultQue.CallStamp)
FROM tTester cor_tTester INNER JOIN tResultQue cor_tResultQue ON (cor_tTester.TesterID = cor_tResultQue.TesterID) INNER JOIN tGroup cor_tGroup ON (cor_tResultQue.GroupID = cor_tGroup.GroupID)
WHERE cor_tTester.TesterID = tTester.TesterID)
order by tTester.LastName
END
IF @SexID <> '*' AND @RaceID = '*' AND @SiteID = '90000'
BEGIN SELECT distinct datediff(dd, getdate(), tGroup.ScheduleStamp) * -1 as DaysPast, tResultQue.TesterID, tTester.LastName, tTester.FirstName, tTester.WorkNo, tTester.WorkExtension as WorkExt, tTester.HomeNo, tTester.SexID as Sex, tTester.Birth, tTester.RaceID as Race, Poof.CallStamp as CallActivity, Poof.StudyNo as StudyActivity, Poof.QueStatusID as Status , TCall.CallFrom, TCall.CallTo
FROM tGroup INNER JOIN tResultQue ON (tGroup.GroupID = tResultQue.GroupID) INNER JOIN tTester ON (tResultQue.TesterID = tTester.TesterID) left join @CAct as Poof on (Poof.TesterID = tTester.TesterID) left join @CallFT as TCall on (TCall.TesterID = tTester.TesterID)
WHERE tTester.SexID = @SexID AND tTester.Birth >= @LBirth AND tTester.Birth <= @UBirth AND tGroup.ScheduleStamp <= @DD AND tTester.TesterID NOT IN
(SELECT distinct tTester.TesterID
FROM tTester INNER JOIN tResultQue ON (tTester.TesterID = tResultQue.TesterID) INNER JOIN tGroup ON (tResultQue.GroupID = tGroup.GroupID)
WHERE tGroup.ScheduleStamp > @DD
GROUP BY tTester.TesterID)
AND
tGroup.ScheduleStamp = (SELECT MAX(cor_tGroup.ScheduleStamp)
FROM tTester cor_tTester INNER JOIN tResultQue cor_tResultQue ON (cor_tTester.TesterID = cor_tResultQue.TesterID) INNER JOIN tGroup cor_tGroup ON (cor_tResultQue.GroupID = cor_tGroup.GroupID)
WHERE cor_tTester.TesterID = tTester.TesterID)
and
tResultQue.CallStamp = (SELECT MAX(cor_tResultQue.CallStamp)
FROM tTester cor_tTester INNER JOIN tResultQue cor_tResultQue ON (cor_tTester.TesterID = cor_tResultQue.TesterID) INNER JOIN tGroup cor_tGroup ON (cor_tResultQue.GroupID = cor_tGroup.GroupID)
WHERE cor_tTester.TesterID = tTester.TesterID)
order by tTester.LastName
END
IF @SexID <> '*' AND @RaceID <> '*' AND @SiteID <> '90000'
BEGIN SELECT distinct datediff(dd, getdate(), tGroup.ScheduleStamp) * -1 as DaysPast, tResultQue.TesterID, tTester.LastName, tTester.FirstName, tTester.WorkNo, tTester.WorkExtension as WorkExt, tTester.HomeNo, tTester.SexID as Sex, tTester.Birth, tTester.RaceID as Race, Poof.CallStamp as CallActivity, Poof.StudyNo as StudyActivity, Poof.QueStatusID as Status, TCall.CallFrom, TCall.CallTo
FROM tGroup INNER JOIN tResultQue ON (tGroup.GroupID = tResultQue.GroupID) INNER JOIN tTester ON (tResultQue.TesterID = tTester.TesterID) left join @CAct as Poof on (Poof.TesterID = tTester.TesterID) left join @CallFT as TCall on (TCall.TesterID = tTester.TesterID)
WHERE tTester.SexID = @SexID AND tTester.RaceID = @RaceID AND tTester.Birth >= @LBirth AND tTester.Birth <= @UBirth AND tTester.SiteID = @SiteID AND tGroup.ScheduleStamp <= @DD AND tTester.TesterID NOT IN
(SELECT distinct tTester.TesterID
FROM tTester INNER JOIN tResultQue ON (tTester.TesterID = tResultQue.TesterID) INNER JOIN tGroup ON (tResultQue.GroupID = tGroup.GroupID)
WHERE tGroup.ScheduleStamp > @DD
GROUP BY tTester.TesterID)
AND
tGroup.ScheduleStamp = (SELECT MAX(cor_tGroup.ScheduleStamp)
FROM tTester cor_tTester INNER JOIN tResultQue cor_tResultQue ON (cor_tTester.TesterID = cor_tResultQue.TesterID) INNER JOIN tGroup cor_tGroup ON (cor_tResultQue.GroupID = cor_tGroup.GroupID)
WHERE cor_tTester.TesterID = tTester.TesterID)
and
tResultQue.CallStamp = (SELECT MAX(cor_tResultQue.CallStamp)
FROM tTester cor_tTester INNER JOIN tResultQue cor_tResultQue ON (cor_tTester.TesterID = cor_tResultQue.TesterID) INNER JOIN tGroup cor_tGroup ON (cor_tResultQue.GroupID = cor_tGroup.GroupID)
WHERE cor_tTester.TesterID = tTester.TesterID)
order by tTester.LastName
END
IF @SexID <> '*' AND @RaceID <> '*' AND @SiteID = '90000'
BEGIN SELECT distinct datediff(dd, getdate(), tGroup.ScheduleStamp) * -1 as DaysPast, tResultQue.TesterID, tTester.LastName, tTester.FirstName, tTester.WorkNo, tTester.WorkExtension as WorkExt, tTester.HomeNo, tTester.SexID as Sex, tTester.Birth, tTester.RaceID as Race, Poof.CallStamp as CallActivity, Poof.StudyNo as StudyActivity, Poof.QueStatusID as Status, TCall.CallFrom, TCall.CallTo
FROM tGroup INNER JOIN tResultQue ON (tGroup.GroupID = tResultQue.GroupID) INNER JOIN tTester ON (tResultQue.TesterID = tTester.TesterID) left join @CAct as Poof on (Poof.TesterID = tTester.TesterID) left join @CallFT as TCall on (TCall.TesterID = tTester.TesterID)
WHERE tTester.SexID = @SexID AND tTester.RaceID = @RaceID AND tTester.Birth >= @LBirth AND tTester.Birth <= @UBirth AND tGroup.ScheduleStamp <= @DD AND tTester.TesterID NOT IN
(SELECT distinct tTester.TesterID
FROM tTester INNER JOIN tResultQue ON (tTester.TesterID = tResultQue.TesterID) INNER JOIN tGroup ON (tResultQue.GroupID = tGroup.GroupID)
WHERE tGroup.ScheduleStamp > @DD
GROUP BY tTester.TesterID)
AND
tGroup.ScheduleStamp = (SELECT MAX(cor_tGroup.ScheduleStamp)
FROM tTester cor_tTester INNER JOIN tResultQue cor_tResultQue ON (cor_tTester.TesterID = cor_tResultQue.TesterID) INNER JOIN tGroup cor_tGroup ON (cor_tResultQue.GroupID = cor_tGroup.GroupID)
WHERE cor_tTester.TesterID = tTester.TesterID)
and
tResultQue.CallStamp = (SELECT MAX(cor_tResultQue.CallStamp)
FROM tTester cor_tTester INNER JOIN tResultQue cor_tResultQue ON (cor_tTester.TesterID = cor_tResultQue.TesterID) INNER JOIN tGroup cor_tGroup ON (cor_tResultQue.GroupID = cor_tGroup.GroupID)
WHERE cor_tTester.TesterID = tTester.TesterID)
order by tTester.LastName
END
IF @SexID = '*' AND @RaceID <> '*' AND @SiteID <> '90000'
BEGIN SELECT distinct datediff(dd, getdate(), tGroup.ScheduleStamp) * -1 as DaysPast, tResultQue.TesterID, tTester.LastName, tTester.FirstName, tTester.WorkNo, tTester.WorkExtension as WorkExt, tTester.HomeNo, tTester.SexID as Sex, tTester.Birth, tTester.RaceID as Race, Poof.CallStamp as CallActivity, Poof.StudyNo as StudyActivity, Poof.QueStatusID as Status, TCall.CallFrom, TCall.CallTo
FROM tGroup INNER JOIN tResultQue ON (tGroup.GroupID = tResultQue.GroupID) INNER JOIN tTester ON (tResultQue.TesterID = tTester.TesterID) left join @CAct as Poof on (Poof.TesterID = tTester.TesterID) left join @CallFT as TCall on (TCall.TesterID = tTester.TesterID)
WHERE tTester.RaceID = @RaceID AND tTester.Birth >= @LBirth AND tTester.Birth <= @UBirth AND tTester.SiteID = @SiteID AND tGroup.ScheduleStamp <= @DD AND tTester.TesterID NOT IN
(SELECT distinct tTester.TesterID
FROM tTester INNER JOIN tResultQue ON (tTester.TesterID = tResultQue.TesterID) INNER JOIN tGroup ON (tResultQue.GroupID = tGroup.GroupID)
WHERE tGroup.ScheduleStamp > @DD
GROUP BY tTester.TesterID)
AND
tGroup.ScheduleStamp = (SELECT MAX(cor_tGroup.ScheduleStamp)
FROM tTester cor_tTester INNER JOIN tResultQue cor_tResultQue ON (cor_tTester.TesterID = cor_tResultQue.TesterID) INNER JOIN tGroup cor_tGroup ON (cor_tResultQue.GroupID = cor_tGroup.GroupID)
WHERE cor_tTester.TesterID = tTester.TesterID)
and
tResultQue.CallStamp = (SELECT MAX(cor_tResultQue.CallStamp)
FROM tTester cor_tTester INNER JOIN tResultQue cor_tResultQue ON (cor_tTester.TesterID = cor_tResultQue.TesterID) INNER JOIN tGroup cor_tGroup ON (cor_tResultQue.GroupID = cor_tGroup.GroupID)
WHERE cor_tTester.TesterID = tTester.TesterID)
order by tTester.LastName
END
IF @SexID = '*' AND @RaceID <> '*' AND @SiteID = '90000'
BEGIN SELECT distinct datediff(dd, getdate(), tGroup.ScheduleStamp) * -1 as DaysPast, tResultQue.TesterID, tTester.LastName, tTester.FirstName, tTester.WorkNo, tTester.WorkExtension as WorkExt, tTester.HomeNo, tTester.SexID as Sex, tTester.Birth, tTester.RaceID as Race, Poof.CallStamp as CallActivity, Poof.StudyNo as StudyActivity, Poof.QueStatusID as Status, TCall.CallFrom, TCall.CallTo
FROM tGroup INNER JOIN tResultQue ON (tGroup.GroupID = tResultQue.GroupID) INNER JOIN tTester ON (tResultQue.TesterID = tTester.TesterID) left join @CAct as Poof on (Poof.TesterID = tTester.TesterID) left join @CallFT as TCall on (TCall.TesterID = tTester.TesterID)
WHERE tTester.RaceID = @RaceID AND tTester.Birth >= @LBirth AND tTester.Birth <= @UBirth AND tGroup.ScheduleStamp <= @DD AND tTester.TesterID NOT IN
(SELECT distinct tTester.TesterID
FROM tTester INNER JOIN tResultQue ON (tTester.TesterID = tResultQue.TesterID) INNER JOIN tGroup ON (tResultQue.GroupID = tGroup.GroupID)
WHERE tGroup.ScheduleStamp > @DD
GROUP BY tTester.TesterID)
AND
tGroup.ScheduleStamp = (SELECT MAX(cor_tGroup.ScheduleStamp)
FROM tTester cor_tTester INNER JOIN tResultQue cor_tResultQue ON (cor_tTester.TesterID = cor_tResultQue.TesterID) INNER JOIN tGroup cor_tGroup ON (cor_tResultQue.GroupID = cor_tGroup.GroupID)
WHERE cor_tTester.TesterID = tTester.TesterID)
and
tResultQue.CallStamp = (SELECT MAX(cor_tResultQue.CallStamp)
FROM tTester cor_tTester INNER JOIN tResultQue cor_tResultQue ON (cor_tTester.TesterID = cor_tResultQue.TesterID) INNER JOIN tGroup cor_tGroup ON (cor_tResultQue.GroupID = cor_tGroup.GroupID)
WHERE cor_tTester.TesterID = tTester.TesterID)
order by tTester.LastName
END
GO
|
|
|
|
|
This looks like some sort of dynamic search procedure. Stored procedures are a particularly poor fit for this sort of thing. It is far easier to write dynamic SQL on the client.
If you absolutely have to write it in a stored procedure, then you should consider using the exec command inside the stored proc. That will let you execute dynamically constructed SQL, which would be much simpler.
By this I mean that you can dynamically build the SQL string (based on the parameters), much as you could in a normal programming language.
my blog
|
|
|
|
|
Just my 2 cents....
Sql S 2000?
I would put this part into a table valued function:
For sex I would use and in (i.e WHERE ttester.sexid in(@sexid):
IF @sexid = '*' SET @sexid = 'm,f'
That would narrow it down a bit
BEGIN SELECT distinct datediff(dd, getdate(), tGroup.ScheduleStamp) * -1 as DaysPast, tResultQue.TesterID, tTester.LastName, tTester.FirstName, tTester.WorkNo, tTester.WorkExtension as WorkExt, tTester.HomeNo, tTester.SexID as Sex, tTester.Birth, tTester.RaceID as Race, Poof.CallStamp as CallActivity, Poof.StudyNo as StudyActivity, Poof.QueStatusID as Status, TCall.CallFrom, TCall.CallTo
FROM tGroup INNER JOIN tResultQue ON (tGroup.GroupID = tResultQue.GroupID) INNER JOIN tTester ON (tResultQue.TesterID = tTester.TesterID) left join @CAct as Poof on (Poof.TesterID = tTester.TesterID) left join @CallFT as TCall on (TCall.TesterID = tTester.TesterID)
WHERE tTester.Birth >= @LBirth AND tTester.Birth <= @UBirth AND tGroup.ScheduleStamp <= @DD AND tTester.TesterID
Then I would call the function:
SELECT Distinct dayspast,etc*
From dbo.myfunction(@sexid,@vars...etc) f
WHERE not exists (
SELECT tTester.TesterID (don't need distinct or group.)
FROM tTester INNER JOIN tResultQue ON (tTester.TesterID = tResultQue.TesterID) INNER JOIN tGroup ON (tResultQue.GroupID = tGroup.GroupID)
WHERE tGroup.ScheduleStamp > @DD
and f.testerid = tTester.TesterID
)
AND
f.ScheduleStamp = (SELECT MAX(cor_tGroup.ScheduleStamp)
FROM tTester cor_tTester INNER JOIN tResultQue cor_tResultQue ON (cor_tTester.TesterID = cor_tResultQue.TesterID) INNER JOIN tGroup cor_tGroup ON (cor_tResultQue.GroupID = cor_tGroup.GroupID)
WHERE cor_tTester.TesterID = f.TesterID)
and
tResultQue.CallStamp = (SELECT MAX(cor_tResultQue.CallStamp)
FROM tTester cor_tTester INNER JOIN tResultQue cor_tResultQue ON (cor_tTester.TesterID = cor_tResultQue.TesterID) INNER JOIN tGroup cor_tGroup ON (cor_tResultQue.GroupID = cor_tGroup.GroupID)
WHERE cor_tTester.TesterID = f.TesterID)
order by f.LastName
|
|
|
|
|
To All,
I have written a database application using MS Visual C++ 6.0 and MFC. I am using the CDao classes (and using the Jet 3.5 engine/MS Access 97).
The application seems to work very well and I have many installations of the application and satisfied customers.
Now I am switching to Visual Studio .NET. I’d like to continue to use MFC and write my code using Visual C++, however, I have read that DAO is becoming obsolete and when I compile using .NET I get the ‘deprecated’ warning whenever the compiler sees a reference to DAO.
So I need to switch to a new DB technology. I liked DAO because I could directly read and write to an Access database without having to register the DB as an ODBC.
Is there any recommendation on the correct technology to use? The database/application needs to allow for multiple users from multiple computers. It is a client/server type of application and must initially read and write to an Access database. The long term plan is to go to an SQL Server so this should be taken into consideration.
Thank You
|
|
|
|
|
KMerker wrote:
It is a client/server type of application and must initially read and write to an Access database. The long term plan is to go to an SQL Server so this should be taken into consideration.
Is there any particular reason why it must read/write to Access?
Given that you've been using Access as your database server until now and you want to move to SQL Server I'd suggest MSDE which uses the SQL Server engine, but is somewhat limited (no GUI admin tools, limited numbers of users and so on). You can also link it to MS Access if necessary, and you can use SQL Server's admin tools to connect to an MSDE database.
Does this help?
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
The Second EuroCPian Event will be in Brussels on the 4th of September
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
|
|
|
|
|
I highly recommend using ADO. It almost as simple as DAO and it offers greater flexibility.
Regarding the need for ODBC, I don't believe is it required for ADO to work. But i might confuse things with DSN. Regardless, you can use Microsoft Jet to connect directly to ADO.
Its the same technology as used by .NET or even VBScript/JScript on web servers. I've learnt to use it mostly with MSDN examples. The concept seems obscure at first, but its COM+ related.
|
|
|
|
|
hi everyone
my problem is that i can't update any field in the datalist ..i use the update event handeler ...when i try to update any field ...the field remains with its initial value...and when i debug the page...i noticed that the value of
((TextBox)cell[x].cotrol[0]).text is equal to ""..that it can't feel the value i insert...how can i solve this..
thx alot
|
|
|
|
|
1.can i create a table from stored proc?
2.can i insert/delete/update a table from sp?
3.wots that extended sp can do that ordinary sp cannot?
NOTE: I dont have access to SQL server of any type.
|
|
|
|
|
xcavin wrote:
NOTE: I dont have access to SQL server of any type.
Then what do you care?
1) Yes
2) Yes
3) Extended sp can access non-TSQL code and therefore system resourses other than the SQL Server itself.
|
|
|
|
|
Michael Potter wrote:
Then what do you care?
Learning SQL programing without access to SQL server.
Coz nothing can stop me.;)
|
|
|
|
|
xcavin wrote:
Learning SQL programing without access to SQL server.
Then how will you know you are learning correctly?
Why now download MSDE and use that? Or if you want to learn all the GUI tools also there is also a 120 day trial you can download also.
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
The Second EuroCPian Event will be in Brussels on the 4th of September
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
|
|
|
|
|
Hi
I'm going to try to explain what i'm trying to do and if someone is able to give pointers on what i'm doing wrong i would be very grateful.
The app has one background task (service) and one configure application.
The background service loads a typed dataset from a sql server on startup and copies it to the remoting object with DataSet.Merge() wich exposes this over remoting.
settings.TrendTags = sql.GetTrendTags();
RemoteSettings.TrendTags.Merge(settings.TrendTags);
RemotingServices.Marshal(RemoteSettings, "Trend");
This seams to work ok. After Merge() both datatables count property returns the same. (2)
I then load the DataSet in the client app and copies it to a local dataset for modification
Reason for not using the remoting object directly is the inability to see properties while debugging.
settings = (SrvSettings)Activator.GetObject(typeof(SrvSettings) , "tcp://localhost:4188/Trend");
LocalSettings.TrendTags.Merge(settings.TrendTags);
Also this works ok. LocalSettings Contains the full recordset.
Then the user edits the recordset with something like.
TrendTable.TrendTagsRow tr = (TrendTable.TrendTagsRow)LocalSettings.TrendTags.TrendTags.NewRow();
tr.SomeProperty = "Something";
LocalSettings.TrendTags.TrendTags.Rows.Add(tr);
LocalSettings.TrendTags.TrendTags.Count now reports one more.
I then try to apply this change to the remoting object with
settings.TrendTags.Merge(LocalSettings.TrendTags);
I've tried some different things but DataTable, DataSet GetChanges ApplyChanges() etc...
but i cannot with merge get the added row to go into settings wich is the remoting object.
I've done the exact same thing twice before with success but this time it refuse to work.
Anyone know why?
Fredrik Högberg
|
|
|
|
|
Hey guys, what am I missing here? System.Data.OracleClient gets installed with .NET Framework 1.1, correct? If I set up a "using System.Data.OracleClient;" in my C# code, I get an error message that says "The type or namespace name 'OracleClient' does not exist in the class or namespace 'System.Data' (are you missing an assembly reference?)".
I looked in C:\windows\Microsoft.NET\Framework\v1.1.4322, and yes, there is a System.Data.OracleClient.dll file. So I think I'm missing something easy... anybody come across this yet?
Oh the PC is Windows XP Pro, and I'm using Visual Studio 2003 Enterprise Architect, with .NET framework 1.1 - the 1.0 framework has never been installed on this PC (the computer is one month new). If, inside of the VS.NET IDE, I start typing "using System.Data.", Intellisense only shows me choices of "Common, Odbc, OleDb, SqlClient, SqlTypes". OracleClient isn't on the Intellisense list, but even if I force-type it, I still get that build error.
Thanks!
-Thomas
|
|
|
|
|
Looks like you have not added the reference to System.Data.OracleClient.dll. Check it out
Bhaskara
|
|
|
|
|
Yep, that was the problem. Just had to right-click "references" in the project window, and say "Add"!
-Thomas
|
|
|
|
|
Hi,
I'm in a situation where my VB.NET code will know the name of a database, and can connect to it, but needs to get the mdf and ldf file names for that database. Is there a property of some ADO.NET object that will tell me the file names? Or maybe a query to run to get the file names?
Thanks
David
|
|
|
|
|
In the master database there is a system table called sysdatabases which gives the full path to the primary file of each database. In each database itself there are two system tables that would be useful to you the first is sysfilegroups which joins to sysfiles . It is sysfiles that actually contains the list of files for the database.
If you need more information the SQL Server books on-line should fill in all the details you need.
Does this help?
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
The Second EuroCPian Event will be in Brussels on the 4th of September
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
|
|
|
|
|
That's exactly what I needed, thanks!
David
|
|
|
|
|
is there some way to convert a access database to a mysql ? I am not interested in expensive tools , as i can not pay for this .
|
|
|
|
|
The only technical thing I know about Access is that it never should have been written. Even MSDE is better than Access! To be safe, I'd export the Access database as a CSV file, manually create your schema inside MySql, and then tell MySql to import the CSV file. It's a little more work then a fancy point & click tool, but you know your data will go through perfectly.
-Thomas
|
|
|
|
|