Database Woes

Last post 09-26-2006 11:34 PM by leon_lia. 13 replies.

Sort Posts:

  • Database Woes

    07-14-2006, 3:54 PM
    • Member
      80 point Member
    • nwind
    • Member since 07-14-2006, 7:46 PM
    • Posts 16

    I am unable to get any version of MS SQL to accept the database.  I have tried the 2000 version, the 2005 version, the desktop engine and even tried Access.  I cannot attach the database without the .ldf file, which isn't there.  It will not import to SQL, Access or even Excel.  How are all of you people getting the database into a database server?

    Feeling dumb here!

     

  • Re: Database Woes

    07-14-2006, 6:48 PM
    • Member
      695 point Member
    • justin0501
    • Member since 01-18-2006, 2:00 PM
    • Posts 138
    Run the scripts in Query Analyzer
  • Re: Database Woes

    07-17-2006, 2:26 PM
    • Member
      80 point Member
    • nwind
    • Member since 07-14-2006, 7:46 PM
    • Posts 16

    I absolutely cannot connect to the database.  Running the three stored procedures produces no errors but no tables either.  Is there any sort of setup instructions for this other than the index.html which really says nothing?  I cannot get to the default.aspx since my database contains no data. 

  • Re: Database Woes

    07-17-2006, 2:41 PM
    • Member
      695 point Member
    • justin0501
    • Member since 01-18-2006, 2:00 PM
    • Posts 138

    Did you create the Classifieds database by running the scripts?

    You also have to create the aspnet database by running the aspnet_reqsql utility. If you cannot you will need your host to create that for you.

    If you have those created are you getting any error message?

     

  • Re: Database Woes

    07-17-2006, 4:12 PM
    • Member
      80 point Member
    • nwind
    • Member since 07-14-2006, 7:46 PM
    • Posts 16

    I am the host!  I have no idea what to do with this program though I desperately want to use it.  From the point of unzipping it there isn't a clue what to do.  I cannot get any of my MS database programs, not the desktop engine, not Sequel Server 2000, not Sequel Server 2005 to recognise the classifiedsdb.mdf as any sort of valid file.  I have run the three .sql files in the 2005 query analyzer.  They give no errors but neither do they do anything except indicate that they are finished running.  I am completely baffled by what the connection string should look like, the one that is in the web.config doesn't appear to be even close.

    So many people seem to be using this, I can't believe I am having so much trouble.  I use database connections from both ASP.NET and PHP all the time, but this one really has me buffaloed!

  • Re: Database Woes

    07-17-2006, 6:56 PM
    • Member
      695 point Member
    • justin0501
    • Member since 01-18-2006, 2:00 PM
    • Posts 138

    So you do not even have any database created yet?? What version of SQL do you have installed?

    I dont think you should worry about the Connection String in the web.config until you actually get your databases created.

    There should be 2 sql scripts that you need to run:

    Classifieds-add and Classifieds-categories

    If you run the Classifieds-remove you are deleting your database, stored procs, views...etcc..

    So bascially create a new database is SQL Server, and then run those two scripts and then check to see if the tables, stored procs, views etc are there.

    After that you then need to create the aspnetdb by running the aspnet_regsql utility. You can create those tables and stored procs in the same database if you want to, but in any case no matter how you do it you have to run that aspnet_regsql utility.

    Then once you get your databases created, then you can worry about the connection string which is quite easy to modify to point to your database(s).

  • Re: Database Woes

    07-18-2006, 3:24 PM
    • Member
      80 point Member
    • nwind
    • Member since 07-14-2006, 7:46 PM
    • Posts 16

    I now have the database installed and appearing to be happy but still cannot connect.  I have two physical servers so am trying on each of them to see whether I can get either to fly.  Both are IIS machines with ASP.NETv2.0.  The first is using MSDE with SQL 2000 client tools.  The second has a full install of MS Sql 2005.  At this point I am having the same problem on both:  error 26, error locating server/instance.  In the webconfig file, I used the full local path the database and the sa username and password.

    Your help is very much appreciated!

     

    Pat

  • Re: Database Woes

    07-18-2006, 6:14 PM
    • Member
      695 point Member
    • justin0501
    • Member since 01-18-2006, 2:00 PM
    • Posts 138

    Now that could be a connection string issue. Try the following connection strings:

    <add name="classifiedsConnection" connectionString="Data Source=SERVER;Database=CLASSIFIEDSDB;User ID=USERID;Password=PASSWORD;Trusted_Connection=False" providerName="System.Data.SqlClient=" />
    <remove name="LocalSqlServer"/>
    <add name="LocalSqlServer" connectionString="Server=SERVER;Database=ASPNETDB;User ID=USERID;Password=PASSWORD;Trusted_Connection=False" providerName="System.Data.SqlClient" />

  • Re: Database Woes

    07-19-2006, 7:17 PM
    • Member
      80 point Member
    • nwind
    • Member since 07-14-2006, 7:46 PM
    • Posts 16
    Again, I sure appreciate your effort but there seems to be no way to connect to this database. I even added a copy on a 2000 Sequel install.  In all cases, I can create an ODBC connector that connects to the database successfully, either on the local machine or from a remote machine, but there I cannot get the program to admit it exists!  Talk about frustration!
  • Re: Database Woes

    07-19-2006, 7:38 PM
    • Member
      695 point Member
    • justin0501
    • Member since 01-18-2006, 2:00 PM
    • Posts 138

    Are you getting any specific error messages? Post the messages if you are.

    I'm not sure what else it could be. If SQL is configured correctly and the databases are setup the connection strings I posted should be correct as those are the ones that I use and they work fine for me

  • Re: Database Woes

    07-20-2006, 5:21 PM
    • Member
      80 point Member
    • nwind
    • Member since 07-14-2006, 7:46 PM
    • Posts 16
    Things are definitely better today (on the 2005 box with the database local).  It is now only complaining about not finding stored procedures.  It is correct, they are not there.  I will search the forums for that one!
  • Re: Database Woes

    07-20-2006, 6:20 PM
    • Member
      185 point Member
    • scokim
    • Member since 06-07-2006, 12:26 PM
    • Posts 47
    You can consider Backing up the local db and then Restoring the .Bak file onto the server. The stored procedures will follow.
  • Re: Database Woes

    07-21-2006, 11:15 AM
    • Member
      80 point Member
    • nwind
    • Member since 07-14-2006, 7:46 PM
    • Posts 16
    There are many stored procedures there, to be sure, but the one it is complaining about is dbo.GetAdsByRandomOrder and it really is not there. 
  • Re: Database Woes

    09-26-2006, 11:34 PM
    • Member
      35 point Member
    • leon_lia
    • Member since 12-11-2003, 5:27 PM
    • Posts 7
    Great, thanks very much

    with your suggestions, i could see "Classifieds Online" lah,

    With db SQL Server 2000

    step1. create db classifieds
    step2. execute script classifieds-add.sql
    step3. execute script classifieds-categories.sql
    step4. create db aspnet
    step5. execute aspnet_regsql point to db aspnet
    step6. modify Web.config file as below
        <connectionStrings>
            <!--
            <add name="classifiedsConnection" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\classifiedsdb.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
            -->
            <add name="classifiedsConnection" connectionString="Data Source=localhost;Database=classifieds;User ID=sa;Password=sa;Trusted_Connection=False" providerName="System.Data.SqlClient=" />
            <remove name="LocalSqlServer"/>
            <add name="LocalSqlServer" connectionString="Server=localhost;Database=aspnet;User ID=sa;Password=sa;Trusted_Connection=False" providerName="System.Data.SqlClient" />
        </connectionStrings>

    That's all, then run the site from Visual Studio, thx
Page 1 of 1 (14 items)