<% 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 "" & vbCrLf Response.Write vbTab & "" & vbCrLf Response.Write vbTab & vbTab & "" & vbCrLf Response.Write vbTab & vbTab & "" & vbCrLf Response.Write vbTab & vbTab & "" & vbCrLf Response.Write vbTab & vbTab & "" & vbCrLf Response.Write vbTab & vbTab & "" & vbCrLf Response.Write vbTab & vbTab & "" & vbCrLf Response.Write vbTab & vbTab & "" & vbCrLf Response.Write vbTab & vbTab & "" & vbCrLf Response.Write vbTab & vbTab & "" & vbCrLf Response.Write vbTab & vbTab & "" & vbCrLf Response.Write vbTab & vbTab & "" & vbCrLf Response.Write vbTab & vbTab & "" & vbCrLf Response.Write vbTab & vbTab & "" & vbCrLf Response.Write vbTab & vbTab & "" & vbCrLf Response.Write vbTab & vbTab & "" & vbCrLf Response.Write vbTab & vbTab & "" & vbCrLf Response.Write vbTab & "" & vbCrLf If Not rs.EOF Then rs.MoveFirst 'Show data Do While Not rs.EOF Response.Write vbTab & "" & vbCrLf For I = 0 To rs.Fields.Count - 1 Response.Write vbTab & vbTab & "" & vbCrLf Next Response.Write vbTab & "" & vbCrLf rs.MoveNext Loop End If Response.Write "
DepartmentItemNoItemNameDescriptionPriceQuantityDateAddedDateSoldDateTransferredDateReturnedPictureSmallPictureLargeColorSizeSpecialDiscount
" & rs.Fields(I) & "
" & vbCrLf rs.Close set rs=nothing 'Close Recordset Object conn.Close Set conn=Nothing 'Delete connection Object %> ReadRecords.asp [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => <%Veec.79416$Ig.71860@pd7tw2no> [ref] => [htmlstate] => on_nl2br [postusername] => Steve [ip] => somers12@shaw.c [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 1 [islastshown] => [isfirstshown] => 1 [attachments] => [allattachments] => ) --> Connecting to Access 2002 on local computer - ASP Components
Professional Web Applications Themes

Connecting to Access 2002 on local computer - ASP Components

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 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 ...

  1. #1

    Default 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 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. #2

    Default Re: Connecting to Access 2002 on local computer

    [url]http://www.aspfaq.com/5003[/url]

    Ray at hoem

    "Steve" <somers12shaw.ca> wrote in message
    news:%Veec.79416$Ig.71860pd7tw2no...
    > 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 the database: I want

    Ray at Guest

Similar Threads

  1. connecting Access database on local apache server
    By rudodoo619 in forum Coldfusion Database Access
    Replies: 5
    Last Post: February 27th, 10:25 PM
  2. Access 2002 PDFWriter VBA Code w/WinXP does not work like Access 2000
    By Tony_VBACoder in forum Adobe Acrobat Windows
    Replies: 3
    Last Post: April 30th, 07:44 PM
  3. Connect to Access 20002 on local computer
    By Steve in forum ASP Database
    Replies: 3
    Last Post: April 19th, 05:05 AM
  4. Replies: 1
    Last Post: April 9th, 05:06 PM
  5. Replies: 0
    Last Post: July 15th, 05:43 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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