MSDE

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Joanne

    MSDE

    I would appreciate any help, I'm trying to connect a web front-end to an
    Access 2000 database using MSDE, and I have it working using Jet but would
    like to connect the database using MSDE.



    I would appreciate any advice to where I need to edit the code, the code is
    as follows:



    <%@ Language=VBScri pt %>

    <HTML>

    <HEAD>

    <TITLE>Add New Record</TITLE>



    <%

    strDBPath=serve r.MapPath("Empl oyer.mdb")

    Set Conn = Server.CreateOb ject("ADODB.Con nection")

    Conn.Open "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=" & strDBPath & ";"

    set RS = Server.CreateOb ject("ADODB.Rec ordset")



    Conn.BeginTrans

    RS.Open "Employer",Conn ,3,3

    RS.AddNew

    RS("Employer ID") = Request("Employ er ID")

    RS("Employer Name") = Request("Employ er Name")

    RS("TitleID") = Request("TitleI D")

    RS("Forename") = Request("Forena me")

    RS("Surname") = Request("Surnam e")

    RS("Web Address") = Request("Web Address")

    RS("Email Address") = Request("Email Address")

    RS("Date Recorded") = Request("Date Recorded")

    RS("Employer ClassificationI D") = Request("Employ er ClassificationI D")

    RS.Update

    Conn.CommitTran s



    RS.Close

    Conn.Close

    %>



    </HEAD>

    <BODY>

    Member Registered

    </BODY>

    </HTML>



    As mentioned I would be very grateful for any advice.



    Love,



    Joanne


  • Nigel Rivett

    #2
    Re: MSDE

    Conn.Open "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=" & strDBPath &
    ";"

    see

    LEDBProviderFor SQLServer

    The code would be better with just an insert statement.
    Even better calling a stored procedure with parameters.



    Nigel Rivett
    SQL Server development techniques and sql scripts - Author Nigel Rivett


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!

    Comment

    • Erland Sommarskog

      #3
      Re: MSDE

      Joanne (bill884@hotmai l.com) writes:[color=blue]
      > I would appreciate any help, I'm trying to connect a web front-end to an
      > Access 2000 database using MSDE, and I have it working using Jet but
      > would like to connect the database using MSDE.[/color]

      Now, this sounds a bit funny to me. I've heard of people access SQL Server
      databases from Access, but you want to do it the other way round from
      you ASP code? (I assume what you post is ASP, but I don't know ASP, so
      I could be wrong.) That does not seem very meaningful to me.

      However, assuming that you in fact have a copy of the database that
      you have migrated to SQL Server, then you could do:
      [color=blue]
      > strDBPath=serve r.MapPath("Empl oyer.mdb")[/color]

      Remove this:
      [color=blue]
      > Conn.Open "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=" & strDBPath &
      > ";"[/color]

      Replace with:

      Provider=SQLOLE DB;Integrated Security=SSPI;I nitial Catalog=Employe r

      This assumes that you have MSDE running on the local server. If you
      have MSDE on another machine, you should add Server=SERVERNA ME to
      the connection string.

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

      Books Online for SQL Server SP3 at
      Get the flexibility you need to use integrated solutions, apps, and innovations in technology with your data, wherever it lives—in the cloud, on-premises, or at the edge.

      Comment

      Working...