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%>
<HTML>
<HEAD>
<TITLE>Testing our connection</TITLE>
</HEAD>
<BODY>
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>"
objRS.MoveNext
Wend
objRS.Close
objConn.Close
Set objRS = Nothing
Set objConn = Nothing
%>
</BODY>
</HTML>
I hope someone can shed some light. All the permissions seem to be ok..Im at a loss.
Thanks In Advance
|