Wrox Programmer Forums
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old May 23rd, 2006, 04:10 AM
Registered User
Join Date: Apr 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default connection to dbase

I am running Windows server 2003 as a server with IIS, the files are located in the server under InetPub wwwroot BegASPFiles, I have set up a virtual directory BegASP. I am working from a client machine Win XP Pro, and have had no trouble accessing the ASP pages I have created so far. Up until I tried to connect to an Access database.
I have placed the database in C:/datastores. I am using Movie2000.mdb. The dbase has a table named "Movies" and a column named "Title" with some data.

I run this code good right up until line 21. All will run fine, as soon as I introduce line 22, I get an internal Server error 500.
It doesnt seem to like objConn.Open

'Line 0
<%Option Explicit%>
<TITLE>Testing our connection</TITLE>
See this text?
Dim adOpenForwardOnly, adLockReadOnly, adCmdTable
adOpenForwardOnly = 0
adLockReadOnly = 1
adCmdTable = 2

Dim objConn, objRS
Set objConn = Server.CreateObject("ADODB.Connection")
Set objRS = Server.CreateObject("ADODB.Recordset")

Dim strDatabaseType
strDatabaseType = "Access"
Response.Write "objConn is Access"

objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
               "Data Source=C:\datastores\Movie2000.mdb;" & _
               "Persist Security Info=False"

objRS.Open "Movies", objConn, adOpenForwardOnly, adLockReadOnly, adCmdTable

While Not objRS.EOF
  Response.Write objRS("Title") & "<BR>"

Set objRS = Nothing
Set objConn = Nothing


I hope someone can shed some light. All the permissions seem to be ok..Im at a loss.

Thanks In Advance

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chap 12 connection to a dbase jardbf BOOK: Beginning ASP 3.0 1 May 25th, 2006 11:01 AM
Script To Write to Dbase HELP!!! reidcor VBScript 3 January 20th, 2005 05:12 AM
SQL Server: Copy Table From dbase to other dbase orez SQL Server 2000 3 July 7th, 2004 03:51 AM
ADO connection string to dBase IV EddyT Excel VBA 2 June 21st, 2004 02:59 AM
Repairing an ACCESS Dbase... dgarcia1128 Access 4 March 1st, 2004 03:29 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.