Connect to Access 20002 on local computer

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Connect to Access 20002 on local computer

    Here's the code I'm trying to use; basic ASP code and it just reads the
    records in the database: I want to use it on my local computer where this
    file "ReadRecords.asp" and the "calgarywebconcepts.mdb" file are both in the
    Inventory directory. I'm using Access 2002 and my problem seems to be in how
    I'm trying to connect to the database (the first 13 lines). Can anyone see a
    problem with this?

    Thanks... Steve

    <!--#include file="adovbs.inc"-->
    <%
    dim strconn
    dim rs
    dim conn
    strconn="Provider=Microsoft.Het.OLEBD.3.51; Data
    Source=C:\Inventory\calgarywebconcepts.mdb"

    set conn = Server.CreateObject("ADODB.Connection")
    conn.Open "strconn"

    set rs = Server.CreateObject("ADODB.Recordset")
    rs.Open "Inventory", conn, adOpenStatic, adLockOptimistic, adCmdTable

    Response.Write "<TABLE BORDER=""1"" CELLSPACING=""2"" CELLPADDING=""2"">" &
    vbCrLf
    Response.Write vbTab & "<TR>" & vbCrLf
    Response.Write vbTab & vbTab & "<TD><B>Department</B></TD>" & vbCrLf
    Response.Write vbTab & vbTab & "<TD><B>ItemNo</B></TD>" & vbCrLf
    Response.Write vbTab & vbTab & "<TD><B>ItemName</B></TD>" & vbCrLf
    Response.Write vbTab & vbTab & "<TD><B>Description</B></TD>" & vbCrLf
    Response.Write vbTab & vbTab & "<TD><B>Price</B></TD>" & vbCrLf
    Response.Write vbTab & vbTab & "<TD><B>Quantity</B></TD>" & vbCrLf
    Response.Write vbTab & vbTab & "<TD><B>DateAdded</B></TD>" & vbCrLf
    Response.Write vbTab & vbTab & "<TD><B>DateSold</B></TD>" & vbCrLf
    Response.Write vbTab & vbTab & "<TD><B>DateTransferred</B></TD>" & vbCrLf
    Response.Write vbTab & vbTab & "<TD><B>DateReturned</B></TD>" & vbCrLf
    Response.Write vbTab & vbTab & "<TD><B>PictureSmall</B></TD>" & vbCrLf
    Response.Write vbTab & vbTab & "<TD><B>PictureLarge</B></TD>" & vbCrLf
    Response.Write vbTab & vbTab & "<TD><B>Color</B></TD>" & vbCrLf
    Response.Write vbTab & vbTab & "<TD><B>Size</B></TD>" & vbCrLf
    Response.Write vbTab & vbTab & "<TD><B>Special</B></TD>" & vbCrLf
    Response.Write vbTab & vbTab & "<TD><B>Discount</B></TD>" & vbCrLf

    Response.Write vbTab & "</TR>" & vbCrLf
    If Not rs.EOF Then
    rs.MoveFirst
    'Show data
    Do While Not rs.EOF
    Response.Write vbTab & "<TR>" & vbCrLf
    For I = 0 To rs.Fields.Count - 1
    Response.Write vbTab & vbTab & "<TD>" & rs.Fields(I) & "</TD>" & vbCrLf
    Next
    Response.Write vbTab & "</TR>" & vbCrLf
    rs.MoveNext
    Loop
    End If
    Response.Write "</TABLE>" & vbCrLf

    rs.Close
    set rs=nothing 'Close Recordset Object
    conn.Close
    Set conn=Nothing 'Delete connection Object
    %>
    <html>

    <head>
    <title>ReadRecords.asp</title>
    </head>

    <body BACKGROUND="images/bkg_white.jpg">
    </body>
    </html>




    Steve Guest

  2. Similar Questions and Discussions

    1. Publish To Local Computer
      Please excuse my ignorance, but I would like to know how I can send or publish the files for a flashpaper document in my web page to my home/local...
    2. How can I setup SSL on my LOCAL COMPUTER?
      Hello, I already have setup SSL on my production server via purchasing a certificate and that seems to work fine as I can type in https:// and it...
    3. Connecting to Access 2002 on local computer
      I don't know if I'm in the right newsgroup... but here goes. Here's the code I'm trying to use; basic ASP code and it just reads the records in...
    4. How to test Webservice on Web like on local computer?
      Hi, All I created a Webservice locally, and it returns all coustomers names in XML format when I click "Invoke" button. But when I test from the...
    5. Access entire desktop computer from laptop computer on wireless network
      When I try to set up a network place on my laptop, I browse the locations that I want to setup in the network place set-up wizard but it wont let...
  3. #2

    Default Re: Connect to Access 20002 on local computer

    Are you getting an error? If so, what is it, and on what line?

    Look at your connection string. Provider=Microsoft.___H___et...

    Try this connection string: (Notice Jet 4.0, also)

    "Provider=Microsoft.Jet.OLEDB.4.0;Data
    Source=C:\Inventory\calgarywebconcepts.mdb;"

    Ray at home

    "Steve" <somers12@shaw.ca> wrote in message
    news:dZeec.79434$Ig.3472@pd7tw2no...
    > Here's the code I'm trying to use; basic ASP code and it just reads the
    > records in the database: I want to use it on my local computer where this
    > file "ReadRecords.asp" and the "calgarywebconcepts.mdb" file are both in
    the
    > Inventory directory. I'm using Access 2002 and my problem seems to be in
    how
    > I'm trying to connect to the database (the first 13 lines). Can anyone see
    a
    > problem with this?
    >
    > Thanks... Steve
    >
    > <!--#include file="adovbs.inc"-->
    > <%
    > dim strconn
    > dim rs
    > dim conn
    > strconn="Provider=Microsoft.Het.OLEBD.3.51; Data
    > Source=C:\Inventory\calgarywebconcepts.mdb"
    >

    Ray at Guest

  4. #3

    Default Re: Connect to Access 20002 on local computer

    Or perhaps create a DSN and let the connection string just be the name
    of the DSN.

    Best regards,
    J. Paul Schmidt, Freelance ASP Web Consultant
    [url]http://www.Bullschmidt.com[/url]
    ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...


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

  5. #4

    Default Re: Connect to Access 20002 on local computer

    Don't use a DSN, as it will be an old technology ODBC connection then.

    Ray at home

    "Bullschmidt" <paul@bullschmidt.com-nospam> wrote in message
    news:OxJQ6mcJEHA.2432@TK2MSFTNGP10.phx.gbl...
    > Or perhaps create a DSN and let the connection string just be the name
    > of the DSN.
    >
    > Best regards,
    > J. Paul Schmidt, Freelance ASP Web Consultant
    > [url]http://www.Bullschmidt.com[/url]
    > ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
    >
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    Ray at Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139