Announcement

Collapse
No announcement yet.

How to connect/create an ADBC conection

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to connect/create an ADBC conection

    Hi,

    I used to work with Access and PWS, and now I am upgrading to W2003 Server with SQL server.
    I got the IIS server activates, so I can creat and show ASP files. But conecting me to the ODBC DB is just impossible.
    Where can I say to the DB that it is a ODBC DB.
    I looked almost everywhere and can´t find the option.

    I found the DBs in my HD, but the extention is MDF, not MDB as usual, is that normal?

    Any help is welcome

    Johny
    Last edited by rtr1900; 18th October 2005, 17:47. Reason: Correcting in title

  • #2
    Re: How to connect/create an ADBC conection

    Originally posted by http://www.raosoft.com/ezsurvey/help/ezsurvey/sql_server_setup.html - Edits by ahinson

    First create the DB. Then create a Data Source Name Entry.

    Open the ODBC Data Source Administrator (Administrative Tools->Data Sources (ODBC)) Select the System DSN tab and then click Add.

    1. The Create New Data Source window will open. Select SQL Server. Click Finish.
    2. Type in the name that you want to give the Data Source. Enter your DSN (use whatever you like). Select (local) for the Server. Click Next.
    3. Select With Windows NT authentication using the network login ID. Click Next.
    4. For Change the default database to:, select the database that was created in SQL Server. Click Next.
    5. On the next page Click Finish.
    6. When you run a Data Source Test, it should show the following message "TEST COMPLETED SUCCESSFULLY!".
    7. When you are done, you should see the new System Data Source entry listed.
    Then, you'll need to use the ASP ODBC data provider to connect to the DB.

    Check this out.

    http://support.microsoft.com/kb/q169377/
    Last edited by ahinson; 18th October 2005, 22:36. Reason: Added credit for quote.
    Andrew

    ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

    Comment


    • #3
      Re: How to connect/create an ADBC conection

      Thx Ahinson,

      Youhelped me already a lot. Still I can not connect me using ASP pages.
      I have the global.asa file in the directory BEGASP, and in the IIS I created a new virtual directory, dirfecting to that directory on my HD. So I guess it is alright.
      Still, when ever I start a page with the next code:
      =

      Set OBJdbConnection = Server.CreateObject("ADODB.Connection")
      OBJdbConnection.ConnectionTimeout = Session("ConnectionTimeout")
      OBJdbConnection.CommandTimeout = Session("CommandTimeout")
      OBJdbConnection.Open Session("ConnectionString")
      Set SQLStmt = Server.CreateObject("ADODB.Command")
      Set RS = Server.CreateObject ("ADODB.Recordset")

      =
      It tells me:

      =
      Microsoft OLE DB Provider for ODBC Drivers error '80004005'

      [Microsoft][Administrador de controladores ODBC] No se encuentra el nombre del origen de datos y no se especificó ningún controlador predeterminado

      /index.asp, línea 13

      =

      now this should mean that the global.asa is in a wrong place.
      Suppose the code of the GLOBAL.ASA file should be
      =
      Session("ConnectionString") ="DSN=MYDSNNAME;UID=;PWD=;DATABASE=NAMEOFDB;APP=AS P script"
      Session("ConnectionTimeout") = 15
      Session("CommandTimeout") = 30
      =

      The UID and PWD should contain something? Because the autentificacion is using Windows NT

      I am not sue if now the problem should be in this forum. Anyhow any help is welcome

      Thx

      Johny

      Comment


      • #4
        Re: How to connect/create an ADBC conection

        I have managed to get the conectcion when I use:

        =
        dim conn
        dim rs
        dim sql
        Set conn = server.createobject("adodb.connection")
        conn.open "DSN=NAMEDNS"
        set rssomething = server.createobject("adodb.recordset")
        sql = "SELECT * FROM CLIENTS"
        rs.open sql, conn
        =

        Still it gives me the next error:
        =
        Microsoft OLE DB Provider for ODBC Drivers error '80040e4d'

        [Microsoft][ODBC SQL Server Driver][SQL Server]Error de inicio de sesión del usuario 'DOMAIN\IUSR_MCLAREN'.

        /index.asp, línea 21

        =


        I suppose I need to make some kind of user and password....... Is this done in the ODBC part, IIS part or using the MMC where I found the SQL Server with the Database.
        I thought it would be there, but can´t make it work.....




        Any help is welcome....... Damn, with Access it was so easy


        Johny

        Comment


        • #5
          Re: How to connect/create an ODBC conection

          Change the website to allow Integrated Windows Authentication (under the directory security tab), then change SQL server to allow SQL Server and Windows Authentication.

          Also make sure you have read access for the IIS anonymous account to the folder where the website is located.

          If you need more details about where to find these things I can give you some screenshots later (I'm at work).

          Access works completely different. It uses an OLE DB connection, SQL uses ADO so you can't expect them to be the same or as simple.
          Andrew

          ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

          Comment


          • #6
            Re: How to connect/create an ADBC conection

            Hi Ahinson,

            that would be great if you could show me some images. As I tried what you said, but no results...
            If I put "ACCESS ANONIMOUS", it asks me a username..... but I don´t any anonymous usernames. And if I use mine with my password, it also doesn´t work.

            Maybe I should create the famous "sa" user without a password, but that then again can give access to anybody to the domain....

            Thx again

            Johny

            Comment


            • #7
              Re: How to connect/create an ADBC conection

              Hi Ahinson,


              I finally got it working with no username and no password!
              And I got some data from the DB in SQL Server.

              THX YOU VERY MUCH for all the help!!!! Great job!

              Regards,

              Johny

              Comment


              • #8
                Re: How to connect/create an ADBC conection

                Originally posted by rtr1900
                Hi Ahinson,


                I finally got it working with no username and no password!
                And I got some data from the DB in SQL Server.

                THX YOU VERY MUCH for all the help!!!! Great job!

                Regards,

                Johny
                No problem, I'm glad to have helped.
                Andrew

                ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

                Comment

                Working...
                X