Results 1 to 25 of 25

Thread: sql server problem

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870

    sql server problem

    hi,

    i am trying to do the first sql server example in Karl Moores book but when i try loading the datagrid with data from the KeepFit SQL database i get the following error:

    "SQL Server does not exist or access denied."

    I know it's there tho! Has anybody else had a problem like this?

    Many thanks
    Nick

  2. #2
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Check your sql server permissions. Also, what does your connection string look like. Try using the system administrator (sa) acccount just to get it working then switch it to however authentication you like.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870
    the connection string i am using is

    Code:
    Dim objConnection As New SqlClient.SqlConnection("server=.;database=KeepFit;trusted_connection=true")

    how do i check/change the permissions of the database?

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870
    i changed the connection string to the following:

    Code:
    Dim objConnection As New SqlClient.SqlConnection("server=LAPTOP1-NICK\NETSDK;database=KeepFit;trusted_connection=true")
    i know get an error of:

    "Login failed for user 'LAPTOP1-NICK\ASPNET'. "

    Am i getting any closer?????


    HELLLLLLLLLLLLLLP!

  5. #5
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    If you are using asp.net, grant rights to the aspuser for the database. Or, for a quick work around, use the sa account for your userid and supply the password.

  6. #6
    Lively Member
    Join Date
    Jan 2001
    Posts
    79
    I have just finished the same chapter without any problems. Are you sure that the server is running. I have the same exact message if the server is not running.

    Can you read the database from the server explorer ?

    The server and the server Agent should both be running. Can you check from the server Manager.

    Mine worked using exactly the same syntax as in your first command line, that is the one in the book. If I were you I check that I can work on the tables with Enterprie manager and Server Explorer from VB.net.

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870
    thanks for the replies.

    Both services are definetly running, and i can view the database from the server explorer window.

    how do i go about granting user rights or using the sa account?


    I couldn't get the access database example working with asp.net for similar reasons! :S

  8. #8
    Member EagleEye's Avatar
    Join Date
    May 2002
    Location
    South Carolina, USA
    Posts
    43
    VB Code:
    1. Dim objConnection As New SqlClient.SqlConnection("server=LAPTOP1-NICK\NETSDK;database=KeepFit;user id=sa;password=###")

    Where ### is your password if one is set.
    Eagle Eye

    "Programming is easy ... when you are done."

  9. #9

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870
    Login failed for user 'sa'. Reason: Not associated with a trusted SQL Server connection.


    I get that now!!!

    I think i am gonna cry!

  10. #10
    Member EagleEye's Avatar
    Join Date
    May 2002
    Location
    South Carolina, USA
    Posts
    43
    VB Code:
    1. Dim objConnection As New SqlClient.SqlConnection("server=LAPTOP1-NICK\NETSDK;database=KeepFit;user id=sa;password=###;integrated security=true;persist security info=true")

    Where ### is your password if one is set.

    (Forgot part of it ... not sure it'll help though)
    Eagle Eye

    "Programming is easy ... when you are done."

  11. #11

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870
    i've never been asked for a password so i pressume there isn't one.

    do i just put two '' if there isn't one?

  12. #12
    Member EagleEye's Avatar
    Join Date
    May 2002
    Location
    South Carolina, USA
    Posts
    43
    just remove the ';password=' from the string
    Eagle Eye

    "Programming is easy ... when you are done."

  13. #13

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870
    still says

    Login failed for user 'LAPTOP1-NICK\ASPNET'

  14. #14
    Member EagleEye's Avatar
    Join Date
    May 2002
    Location
    South Carolina, USA
    Posts
    43
    Are you using MSDE or Microsoft SQL?

    It looks like you are using MSDE.

    Do you have Enterprise Manager under Microsoft SQL Server in the start menu?
    Eagle Eye

    "Programming is easy ... when you are done."

  15. #15
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Your connecting via anonymous access. This is why the ASPNET user is failing. He doens't have rights to the database.

  16. #16
    Member EagleEye's Avatar
    Join Date
    May 2002
    Location
    South Carolina, USA
    Posts
    43
    Thus why I am trying to find out if he has the ability to grant ASPNET user database access. Enterprise manager does not come with MSDE to the best of my knowlege.
    Eagle Eye

    "Programming is easy ... when you are done."

  17. #17

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870
    i have msde

  18. #18
    Member EagleEye's Avatar
    Join Date
    May 2002
    Location
    South Carolina, USA
    Posts
    43
    Since you are using MSDE you don't have the benefit of a graphical interface.

    In order for you to add/modify accounts in MSDE you have to use the instructions found here:

    http://support.microsoft.com/default...;en-us;325003&

    It is not a very nice thing for MS to do this to users but ...
    Eagle Eye

    "Programming is easy ... when you are done."

  19. #19

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870
    man that's ****!!!!!!!!!

    bloomin microsoft!

  20. #20

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870
    i've tried doing the stuff in the microsoft document but to no avail.

    think i am gonna give up

    not sure how other people got it to work and yet i can't.


    the only think i can think of is because i have xp home. I had to do a crack to get IIS running on it so perhaps that is it. It runs normal ASP pages ok though.

  21. #21
    Lively Member
    Join Date
    Jan 2001
    Posts
    79

    SQL

    I am not using MSDE I am using SQL personal edition. I think MS should have included some sort of Interface for MSDE as well, else I think it will never take on and people keep preferring Access to SQL.

    If I were you I will try to get some sort of interface, but from VB.net you should be able to log in through serer explorer.

  22. #22

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870
    where can i get sql personal edition from and how much does it cost?

  23. #23
    Member EagleEye's Avatar
    Join Date
    May 2002
    Location
    South Carolina, USA
    Posts
    43
    Just download the trial version (120 day timebomb).

    http://www.microsoft.com/sql/howtobuy/trial.asp
    Eagle Eye

    "Programming is easy ... when you are done."

  24. #24

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870
    downloaded

    http://www.asp.net/webmatrix/

    and can get asp.net pages working on XP home!

    HURRRRAH!

  25. #25
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    I had this problem also, what fixed it for me was switching to mixed mode authentication.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width