Showing posts with label access. Show all posts
Showing posts with label access. Show all posts

Sunday, March 25, 2012

Count Having > 1

I couldn't get this right in SQL, so I tried Access GUI for help and didn't
get much farther.
In the end, I need to return a "1" or "0".
I need to Count the number of duped artists in DODSongs. If the total of any
one artist > 50% of the total artists Then "1" Else "0"
For example: Assume I had 20 songs. If any one artist is listed more than 10
times, I need to return "1"
SELECT DODSongs.ProjectID, COUNT(SELECT DODSongs.Artist FROM DODSongs
GROUP BY DODSongs.Artist HAVING Count(DODSongs.Artist) > 1) AS NumberArtists
FROM DODSongs RIGHT OUTER JOIN
DODProjects ON DODSongs.ProjectID = DODProjects.ID
WHERE (DODProjects.E = 'abc')
GROUP BY DODSongs.ProjectID
thanks!Look at this example
create table Candidate
(
candidateid int not null primary key,
[name] varchar(50) not null
)
create table Candidate_Skills
(
candidate_skills_id int not null primary key,
candidateid int not null references Candidate(candidateid),
skill varchar(20) not null
)
insert into Candidate values (1,'Chris')
insert into Candidate values (2,'Tom')
insert into Candidate values (3,'Mike')
insert into Candidate values (4,'Adam')
insert into Candidate_Skills values (1,1,'DB2')
insert into Candidate_Skills values (2,1,'Sybase')
insert into Candidate_Skills values (3,1,'Siebel')
insert into Candidate_Skills values (4,2,'SQL')
insert into Candidate_Skills values (5,3,'AIX')
insert into Candidate_Skills values (6,3,'Tivoli')
insert into Candidate_Skills values (7,4,'Linux')
insert into Candidate_Skills values (8,4,'VB')
Select Distinct C.CandidateID, D.Name
From
(Select A.CandidateID, A.Candidate_Skills_ID
From Candidate_Skills A
Join Candidate_Skills B
On A.CandidateID = B.CandidateID
Where A.Candidate_Skills_ID > B.Candidate_Skills_ID) AS C
Join Candidate D
On C.CandidateID = D.CandidateID
drop table Candidate_Skills
drop table Candidate
"shank" <shank@.tampabay.rr.com> wrote in message
news:Ovwz77F6FHA.1148@.tk2msftngp13.phx.gbl...
>I couldn't get this right in SQL, so I tried Access GUI for help and didn't
>get much farther.
> In the end, I need to return a "1" or "0".
> I need to Count the number of duped artists in DODSongs. If the total of
> any one artist > 50% of the total artists Then "1" Else "0"
> For example: Assume I had 20 songs. If any one artist is listed more than
> 10 times, I need to return "1"
> SELECT DODSongs.ProjectID, COUNT(SELECT DODSongs.Artist FROM DODSongs
> GROUP BY DODSongs.Artist HAVING Count(DODSongs.Artist) > 1) AS
> NumberArtists
> FROM DODSongs RIGHT OUTER JOIN
> DODProjects ON DODSongs.ProjectID = DODProjects.ID
> WHERE (DODProjects.E = 'abc')
> GROUP BY DODSongs.ProjectID
> thanks!
>|||shank (shank@.tampabay.rr.com) writes:
> I couldn't get this right in SQL, so I tried Access GUI for help and
> didn't get much farther.
> In the end, I need to return a "1" or "0".
> I need to Count the number of duped artists in DODSongs. If the total of
> any one artist > 50% of the total artists Then "1" Else "0"
> For example: Assume I had 20 songs. If any one artist is listed more
> than 10 times, I need to return "1"
> SELECT DODSongs.ProjectID, COUNT(SELECT DODSongs.Artist FROM
> DODSongs GROUP BY DODSongs.Artist HAVING Count(DODSongs.Artist) > 1) AS
> NumberArtists FROM DODSongs RIGHT OUTER JOIN
> DODProjects ON DODSongs.ProjectID = DODProjects.ID
> WHERE (DODProjects.E = 'abc') GROUP BY DODSongs.ProjectID
This might work:
SELECT ProjectID, Artist, CASE(CASE WHEN cnt >= 10 THEN 1 ELSE 0 END)
FROM (SELECT DS.ProjectID, DS.Artist, cnt = COUNT(*)
FROM DODSongs DS
RIGHT JOIN DODProjects DP ON DS.ProjectID = DP.ID
WHERE DP.E = 'abc'
GROUP BY DS.ProjectID , DS.Artist) AS
ORDER BY ProjectID, Artist
What you have in the parentheses is a derived table. Kind of a temp table
within the table, but only logically. SQL Server will compute the entire
query in what it estimates to be the most efficient way.
If this does not answer your question, please include:
o CREATE TABLE statements your tables.
o INSERT statement with sample data.
o The desired output given the sample.
This makes easy to develop a tested solution which solves your problem.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||
"Erland Sommarskog" <esquel@.sommarskog.se> wrote in message
news:Xns970DA5AB21E95Yazorman@.127.0.0.1...
> shank (shank@.tampabay.rr.com) writes:
> This might work:
> SELECT ProjectID, Artist, CASE(CASE WHEN cnt >= 10 THEN 1 ELSE 0 END)
> FROM (SELECT DS.ProjectID, DS.Artist, cnt = COUNT(*)
> FROM DODSongs DS
> RIGHT JOIN DODProjects DP ON DS.ProjectID = DP.ID
> WHERE DP.E = 'abc'
> GROUP BY DS.ProjectID , DS.Artist) AS
> ORDER BY ProjectID, Artist
> What you have in the parentheses is a derived table. Kind of a temp table
> within the table, but only logically. SQL Server will compute the entire
> query in what it estimates to be the most efficient way.
> If this does not answer your question, please include:
> o CREATE TABLE statements your tables.
> o INSERT statement with sample data.
> o The desired output given the sample.
> This makes easy to develop a tested solution which solves your problem.
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
>
========================================
=======
Here's the 2 tables and test data trimmed to the basic needs.
To recap, the process should count the total records per [ProjectID] group,
then count the duped artists per [ProjectID] group. Duped artists cannot
represent more than 50% of any one group. When done [ProjectID] 9 should
return a 1 because there's (12) Artist12 in a group of 23 records.
[ProjectID] 10 should return a 0 because there's (12) records in that group
and Artist1 is there 6 times.
Thanks for your help!
CREATE TABLE [DODProjects] (
[Email] [varchar] (100),
[ID] [numeric](18, 0)
) ON [PRIMARY]
GO
CREATE TABLE [DODSongs] (
[ProjectID] [numeric](18, 0),
[Artist] [varchar] (255),
) ON [PRIMARY]
GO
insert into DODProjects values ('abc',9)
insert into DODProjects values ('abc',10)
insert into DODSongs values (9,'Artist1')
insert into DODSongs values (9,'Artist2')
insert into DODSongs values (9,'Artist3')
insert into DODSongs values (9,'Artist4')
insert into DODSongs values (9,'Artist5')
insert into DODSongs values (9,'Artist6')
insert into DODSongs values (9,'Artist7')
insert into DODSongs values (9,'Artist8')
insert into DODSongs values (9,'Artist9')
insert into DODSongs values (9,'Artist10')
insert into DODSongs values (9,'Artist11')
insert into DODSongs values (9,'Artist12')
insert into DODSongs values (9,'Artist12')
insert into DODSongs values (9,'Artist12')
insert into DODSongs values (9,'Artist12')
insert into DODSongs values (9,'Artist12')
insert into DODSongs values (9,'Artist12')
insert into DODSongs values (9,'Artist12')
insert into DODSongs values (9,'Artist12')
insert into DODSongs values (9,'Artist12')
insert into DODSongs values (9,'Artist12')
insert into DODSongs values (9,'Artist12')
insert into DODSongs values (9,'Artist12')
insert into DODSongs values (10,'Artist1')
insert into DODSongs values (10,'Artist1')
insert into DODSongs values (10,'Artist1')
insert into DODSongs values (10,'Artist1')
insert into DODSongs values (10,'Artist1')
insert into DODSongs values (10,'Artist1')
insert into DODSongs values (10,'Artist2')
insert into DODSongs values (10,'Artist3')
insert into DODSongs values (10,'Artist4')
insert into DODSongs values (10,'Artist5')
insert into DODSongs values (10,'Artist6')
insert into DODSongs values (10,'Artist7')
========================================
===|||shank (shank@.tampabay.rr.com) writes:
> Here's the 2 tables and test data trimmed to the basic needs.
> To recap, the process should count the total records per [ProjectID]
> group, then count the duped artists per [ProjectID] group. Duped artists
> cannot represent more than 50% of any one group. When done [ProjectID] 9
> should return a 1 because there's (12) Artist12 in a group of 23
> records. [ProjectID] 10 should return a 0 because there's (12) records
> in that group and Artist1 is there 6 times.
Thanks for the test data! That made it a little easier. Does this
query meet your needs:
SELECT ProjectID, MAX(CASE WHEN cnt >= 10 THEN 1 ELSE 0 END)
FROM (SELECT DS.ProjectID, DS.Artist, cnt = COUNT(*)
FROM DODSongs DS
RIGHT JOIN DODProjects DP ON DS.ProjectID = DP.ID
WHERE DP.Email = 'abc'
GROUP BY DS.ProjectID , DS.Artist) AS z
GROUP BY ProjectID
ORDER BY ProjectID
The inner query counds artists per project, and the outer query determines
1 or 0 for the project.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||"Erland Sommarskog" <esquel@.sommarskog.se> wrote in message
news:Xns970E5B9E64C2Yazorman@.127.0.0.1...
> shank (shank@.tampabay.rr.com) writes:
> Thanks for the test data! That made it a little easier. Does this
> query meet your needs:
> SELECT ProjectID, MAX(CASE WHEN cnt >= 10 THEN 1 ELSE 0 END)
> FROM (SELECT DS.ProjectID, DS.Artist, cnt = COUNT(*)
> FROM DODSongs DS
> RIGHT JOIN DODProjects DP ON DS.ProjectID = DP.ID
> WHERE DP.Email = 'abc'
> GROUP BY DS.ProjectID , DS.Artist) AS z
> GROUP BY ProjectID
> ORDER BY ProjectID
> The inner query counds artists per project, and the outer query determines
> 1 or 0 for the project.
================================
I appreciate your help, but you are assuming that there will always be 20
songs for a total count. Actually, there can be any number for the total of
songs. There may be 2, 5, 20, or 30 or whatever. I need to count that total
then make sure there's no more than 50% of any one artist.
thanks again!!!|||On Sun, 13 Nov 2005 20:05:25 -0500, shank wrote:

>I appreciate your help, but you are assuming that there will always be 20
>songs for a total count. Actually, there can be any number for the total of
>songs. There may be 2, 5, 20, or 30 or whatever. I need to count that total
>then make sure there's no more than 50% of any one artist.
Hi shank,
Try if this wsuits your needs:
SELECT ProjectID,
CASE WHEN MAX(Cnt) * 2 > (SELECT COUNT(*)
FROM DODSongs
WHERE ProjectID = a.ProjectID)
THEN 1 ELSE 0 END
FROM (SELECT ProjectID, Artist, COUNT(*) AS Cnt
FROM DODSongs
GROUP BY ProjectID, Artist) AS a
GROUP BY ProjectID
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)|||shank (shank@.tampabay.rr.com) writes:
> I appreciate your help, but you are assuming that there will always be
> 20 songs for a total count. Actually, there can be any number for the
> total of songs. There may be 2, 5, 20, or 30 or whatever. I need to
> count that total then make sure there's no more than 50% of any one
> artist.
OK, this one is a little obscure, but more effective that Hugo's query:
SELECT ProjectID,
CASE WHEN 2 * MAX(artistcnt) > SUM(artistcnt) THEN 1 ELSE 0 END
FROM (SELECT DS.ProjectID, artistcnt = COUNT(*)
FROM DODSongs DS
RIGHT JOIN DODProjects DP ON DS.ProjectID = DP.ID
WHERE DP.Email = 'abc'
GROUP BY DS.ProjectID, DS.Artist) AS z
GROUP BY ProjectID
ORDER BY ProjectID
SUM(artistcnt) is in fact the total number of entries for the project.
I am using 2* on the MAX side, rather than / 2 on the count side, to
avoid issues with integer division.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||On Mon, 14 Nov 2005 23:10:31 +0000 (UTC), Erland Sommarskog wrote:
(snip)
>SUM(artistcnt) is in fact the total number of entries for the project.
Neat!
Thanks, Erland!
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)|||This appears to be great so far!
Thanks very much to both of you!!!

count for each month

I have 2 tables in Access 2000 : Members and Messages

I get all the members.Id for a category with a Procedure

List_Members_3 >>>

SELECT Members.Members_Id
FROM Members
WHERE Members.Cat = 3

then I want to get all the Messages of the Members for january 2004

SELECT Count(Messages.Id) AS CountOfId
FROM Messages INNER JOIN List_Members_3 ON Messages.Id = List_Members_3.Id
GROUP BY Year([DateMessages]), Month([DateMessages])
HAVING (((Year([DateMessages]))=2004) AND ((Month([DateMessages]))=1));

I get one row = Count

how can I get 12 rows for each month ?

Month([DateMessages])=(1 to 12)

--------

and how can I avoid >>>

SELECT Count(Messages.Id) AS CountOfId
FROM Messages INNER JOIN List_Members_3 ON Messages.Id = List_Members_3.Id

with sommething like >>>

SELECT Count(Messages.Id) AS CountOfId
FROM Messages Where Messages.Members_Id IN (SELECT Members.Id
FROM Members
WHERE Members.Cat = 3)

thank youuse an integers table:

create table integers ( i integer )
insert into integers values ( 1 )
insert into integers values ( 2 )
insert into integers values ( 3)
insert into integers values ( 4)
insert into integers values ( 5)
insert into integers values ( 6)
insert into integers values ( 7)
insert into integers values ( 8)
insert into integers values ( 9)
insert into integers values ( 10 )
insert into integers values ( 11 )
insert into integers values ( 12 )

then use a LEFT join from the integers to your data using i to match the month number

select i as month
, Count(Messages.Id) as CountOfId
from integers
left outer
join Messages
on i = Month(DateMessages)
and Year(DateMessages) = 2004
inner
join List_Members_3
on Messages.Id = List_Members_3.Id
group
by i|||it seems absolutly crazy and fantastic ! ::-))

thank you !!!

Thursday, March 8, 2012

Could not find stored procedure

I have an Access 2000 database connected to a SQL Server and am trying
to execute my first stored procedure. I created the stored procedure
and verified that it works, but when I try to execute it from Access:

cnn.Execute("sp_IPT")

it says: 'Could not find stored procedure 'sp_IPT'

Any ideas?

Norman B. Scheinin
F-22 Applications Development
M/S 4E-09
(206) 655-7236
norman.b.scheinin@.boeing.comNorman Scheinin (norman.b.scheinin@.boeing.com) writes:
> I have an Access 2000 database connected to a SQL Server and am trying
> to execute my first stored procedure. I created the stored procedure
> and verified that it works, but when I try to execute it from Access:
> cnn.Execute("sp_IPT")
> it says: 'Could not find stored procedure 'sp_IPT'
> Any ideas?

I would guess that you have not specified which database to work in.
You define this with "Initial Catalog" in the connection string. You
can also have a default database set for your SQL login. You can also
specify a three-part name when you invoke the procedure:

cnn.Execute("yourdb..sp_IPT")

I would also like to take the occassion to discourage you from using
sp_ as the first letters in the names of your stored procedures. This
prefix is reserved for system procedures, and SQL Server first looks
in the master database for these. It then looks in your current database,
so the prefix is not the cause for your problem.

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Friday, February 24, 2012

Could not connect to database

Hello I am new to the ASP.NET project and using Microsoft ASP.Net Web Matrix. When I try to connect to an Access Database it is no problem, but do I try to set up an connection with a SQL or MSDE database there is a problem.

It can not connect with my SQL server and gives the error:
Could not create new database.

What can be the problem. My MSSQL Server is running perfect.

Greets
Ben
HollandNeed more information. Are you using a connection string or creating a connection object in Visual Studio. Can you find your SQL Server instance in the VS Server Explorer?

Sunday, February 19, 2012

Could not add ASPNET user to SQL Server.

10:15:50 PM Monday, December 01, 2003: [Fail] Could not add ASPNET user to SQL Server.
SQL Server does not exist or access denied.

hey guys can someone help me out on this or point me to another forum with the same problem and the answer this problem thank youcan you post your connection string?|||sure if i really no where to find it|||would this be it
10:37:20 PM Monday, December 01, 2003: [Checking system requirements]
10:37:20 PM Monday, December 01, 2003: [Pass] Detected a local instance of SQL Server.
10:37:20 PM Monday, December 01, 2003: [Pass] Determined SQL Server version (8.00.194).
10:37:20 PM Monday, December 01, 2003: [Pass] Detected .NET Framework.
10:37:20 PM Monday, December 01, 2003: [Pass] Detected Internet Information Server (IIS).
10:37:21 PM Monday, December 01, 2003: [Begin Sample Configuration]
10:37:22 PM Monday, December 01, 2003: [Pass] Created IIS virtual directory.: AspNetForums
10:37:22 PM Monday, December 01, 2003: [Pass] Determined SQL Server version (8.00.194).
10:37:38 PM Monday, December 01, 2003: [Fail] Could not add ASPNET user to SQL Server.
SQL Server does not exist or access denied.
10:37:38 PM Monday, December 01, 2003: [Done]|||<configuration
<configSections>
<section name="AspNetForumsSettings" type="System.Configuration.NameValueFileSectionHandler, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections
<system.web
<!-- set debugmode to false for running application -->
<compilation debug="false" /
<!-- set customeErrors off while developing -->
<customErrors mode="RemoteOnly" /
<authentication mode="Forms">
<forms name="AspNetWebAuth" loginUrl="~/login.aspx" protection="None" timeout="60" />
</authentication
</system.web
<!-- ASP.NET Forums Config Settings -->
<!--
******************************
Data Provider
-->
<AspNetForumsSettings>
<add key="DataProviderAssemblyPath" value="AspNetForums.dll" /
<!--
******************************
Application Settings
******************************
-->
<add key="availableSkins" value="default;LightBlue"/>
<add key="defaultPageSize" value="25"/>
<add key="connectionString" value="server=localhost;Trusted_Connection=true;database=" />
<add key="defaultDateFormat" value="dd MMM yyyy"/>
<add key="defaultTimeFormat" value="hh:mm tt"/>
<add key="pathToTransformationFile" value="/transform.txt" />
<add key="smtpServer" value="default" /> <!-- Can specify SMTP Server to use to send out emails. Use "default" to use the default Windows 2000 SMTP Server -->
<add key="allowDuplicatePosts" value="false" /><!-- Whether or not you wish to allow messages with duplicate bodies being posted in various forums -->
<add key="dbTimeZoneOffset" value="-6" /><!-- The timezone offset of your database server. (GMT is +0; EST = -5;) -->
<add key="siteName" value="ASP.NET Forums" /><!-- The name of your AspNetForums.NET Web site. -->
<add key="DataProviderClassName" value="AspNetForums.Data.SqlDataProvider" />
<add key="urlWebSite" value="http://localhost" /
<!--
If the ASP.NET Forums are configured to run in a directory that is not
an IIS VRoot, provide the name of that directory here.
<add key="forumsDirectory" value="/Forums" />
--
<!--
******************************
URL Resource Paths
******************************
urlHome - the Url to the home of the application
urlShowPost - The Url to show a particular post.
urlShowAllUsers - The Url to show all users.
urlSearch - The Url to show the search page.
urlSearchForUser - Searchs for posts by a given user.
urlRegister - The Url to register as a user.
urlProfile - The Url to view a user profile.
urlLogin - The Url to redirect the user to in order to login.
urlLogout - The Url to redirect a user to when they opt to logout.
urlShowForum - The Url to show a particular forum.
urlShowForumGroup - The Url to show a particular forum group.
urlShowUserInfo - The Url to show a particular user's information.
urlReplyToPost - The Url to post a reply to an existing post.
urlAddNewPost - The Url to post a new message.
urlEditExistingPostFromModeration - The Url to edit an existing post from the moderation system.
urlEditExistingPostFromAdmin - The Url to edit an existing post from the administration screen.
urlPostModeration - The Url to moderate posts awaiting approval.
urlEditForum - The Url to edit an existing forum.
urlCreateForum - The Url to create a new forum.
urlShowForumsPostsForAdmin - The Url to show a forums posts for editing/deletign (only available through the administration page).

Note, the '&' symbol cannot be parsed all '&' in URL are replaced with '^'
-->
<add key="urlHome" value="/Default.aspx" />
<add key="urlShowPost" value="/ShowPost.aspx?PostID=" />
<add key="urlShowAllUsers" value="/User/ShowAllUsers.aspx" />
<add key="urlSearch" value="/Search/default.aspx" />
<add key="urlQuickSearch" value="/Search/default.aspx?searchText=" />
<add key="urlSearchForPostsByUser" value="/Search/default.aspx?SearchFor=1^SearchText=" />
<add key="urlRegister" value="/User/CreateUser.aspx" />
<add key="urlEditUserProfile" value="/User/EditUserProfile.aspx" />
<add key="urlLogin" value="/login.aspx" />
<add key="urlAdmin" value="/Admin/default.aspx" />
<add key="urlAdminEditUser" value="/Admin/EditUser.aspx?Username=" />
<add key="urlLogout" value="/logout.aspx" />
<add key="urlShowForum" value="/ShowForum.aspx?ForumID=" />
<add key="urlShowForumGroup" value="/ShowForumGroup.aspx?ForumGroupID=" />
<add key="urlShowUserProfile" value="/User/UserProfile.aspx?UserName=" />
<add key="urlReplyToPost" value="/AddPost.aspx?PostID=" />
<add key="urlUserEditPost" value="/EditPost.aspx?PostID=" />
<add key="urlAddNewPost" value="/AddPost.aspx?ForumID=" />
<add key="urlMyForums" value="/User/MyForums.aspx" />
<add key="urlChangePassword" value="/User/ChangePassword.aspx" />
<add key="urlForgotPassword" value="/User/EmailForgottenPassword.aspx" />
<add key="urlModeration" value="/Moderate/default.aspx" />
<add key="urlModerateForumPosts" value="/Moderate/ModerateForum.aspx?ForumId=" />
<add key="urlEditPost" value="/Moderate/EditPost.aspx?PostID=" />
<add key="urlDeletePost" value="/Moderate/DeletePost.aspx?PostID=" />
<add key="urlManageForumPosts" value="/Moderate/ManageForum.aspx?ForumId=" />
<add key="urlMovePost" value="/Moderate/MovePost.aspx?PostID=" />
<add key="urlModerateThread" value="/Moderate/ModerateThread.aspx?PostId=" />
<add key="urlEditForum" value="/Admin/EditForum.aspx?ForumID=" />
<add key="urlCreateForum" value="/Admin/CreateNewForum.aspx" />
<add key="urlShowForumPostsForAdmin" value="/Admin/ShowPosts.aspx?ForumID=" />
<add key="urlMessage" value="/Msgs/default.aspx?MessageId=" />
<add key="urlModerationHistory" value="/Moderate/ModerationHistory.aspx?PostId=" />
</AspNetForumsSettings
<!--
This location tag is used to ensure that only authenticated users can add a new post or reply to
an existing post...
-->
<location path="AddPost.aspx">
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</location
<location path="EditPost.aspx">
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</location
</configuration>|||The user account that you are running the script under needs to have permissions in SQL Server to add a login for the ASPNet user. Are you logged on as a local administrator?

Cheers
Ken|||i am really not sure can u be lil more specific how will no if i am loged in or how i can log into the sql server|||If you are using Windows Integrated Authentication with SQL Server, then your Windows account needs appropriate permissions in SQL Server to be able to add new users to SQL Server.

I suggest you logon as an administrator and run the script. Otherwise, if you are using Mixed Mode security, then you should run the script under "sa" account.

The different security modes are discussed in SQL Server Books Online

Cheers
Ken|||well am running windows xp professional and my user name is has adminastative access|||well i am on windows xp pro and my user account is admin so how do i make my windows have appropriate permission in sql server|||I know above posts are a little dated but i thought that it would be nice to finish up the post.

I think the solution to the problem is to add the user account of the IIS server (typically: IUSR_<computername> ) as a trusted user on SQL server:

<computername>\IUSR_<computername
As for security concerns, I guess that would be up to those configuring thier machines to decide if this is the approach for them.

Could anyone recommend a tutorial for..

I'm using VB to access MDBs, and now I want to expand my work to a SQL server. Does anyone know where someone of my needs can find a suitable tutorial?
Thanks in advence,
Chenhttp://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp

Or

http://www.sqlteam.com/store.asp|||What are you wanting a tutorial on? Not clear...|||I know how to connect to an access database using VB.

I want to connect to an SQL server instead. And I want the transfer to be as swift as possible as I don't want to reprogram everything I did..

But I don't know nothing about SQL servers.

Though I did heard they're relatively easy to move to if you already used access..|||Originally posted by Wolverchenus
I know how to connect to an access database using VB.

I want to connect to an SQL server instead. And I want the transfer to be as swift as possible as I don't want to reprogram everything I did..

But I don't know nothing about SQL servers.

Though I did heard they're relatively easy to move to if you already used access..

Well the short answer is...it depends...

How do you connect to Access now?

I've converted several Access apps to sql server...some port ok, others are impossible...

mostly because the way the front end was written..

In the final analysis, the best reason to go to sql server is to take advantage of the power of the backend...

If your using it just for storage, it may be that it'll be slower...much slower...|||It's to allow multiple connections through multiple computers on a network..

I'm using OLEDB right now. Can we do it Doc?|||Yes, you can do it.

Since nobody has yet suggested a particular title, I'm willing to go out on a limb and suggest The Hitchiker's Guide (http://search.barnesandnoble.com/booksearch/results.asp?WRD=Vaughn+Hitchiker&userid=2WUBPYEBAS&cds2Pid=946) by Bill Vaughn. I think it is a great book for someone getting started!

-PatP|||Anything lighter and free? :D

I'm more of an autodidact.. once someone aims me at the right direction..|||Lighter? I'll lend you a couple of helium balloons!

Free? Other than the obvious comment about "you get what you pay for", there are hundreds of sites that could be a significant help there. Check out the VB forum (http://www.dbforums.com/f15/) here at dbforums, the Microsoft VB.NET (http://msdn.microsoft.com/vbasic/using/) pages, tidbits from Woody's Watch (http://www.woodyswatch.com/), and quite literally thousands of places around the web.

-PatP|||Thanks