Connection Problem with ADODB/Access DB

M

Mohana Santhanam

Hello,

ASP gives me an unspecified error with the following code:

--------------------------------
<%Option Explicit %>
<HTML>
<HEAD>
<TITLE>Testing connection to the database</TITLE>
</HEAD>
<BODY>

<%
Dim strConnect
strConnect= "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\datastores\Acme.mdb;" & _
"Persist Security Info=False"

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")

objConn.Open strConnect

--------------------------------

ASP barfs on the 'objConn.Open strConnect' statement.
Can anyone see why? We have Windows XP Professional
running IIS 5.0. We have also installed .NET framework
v.1.1.

Thanks.
 
P

Paul Clement

¤ Hello,
¤
¤ ASP gives me an unspecified error with the following code:
¤
¤ --------------------------------
¤ <%Option Explicit %>
¤ <HTML>
¤ <HEAD>
¤ <TITLE>Testing connection to the database</TITLE>
¤ </HEAD>
¤ <BODY>
¤
¤ <%
¤ Dim strConnect
¤ strConnect= "Provider=Microsoft.Jet.OLEDB.4.0;" & _
¤ "Data Source=c:\datastores\Acme.mdb;" & _
¤ "Persist Security Info=False"
¤
¤ 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")
¤
¤ objConn.Open strConnect
¤
¤ --------------------------------
¤
¤ ASP barfs on the 'objConn.Open strConnect' statement.
¤ Can anyone see why? We have Windows XP Professional
¤ running IIS 5.0. We have also installed .NET framework
¤ v.1.1.

Without knowing what the actual error is it's difficult to determine what the problem is. However, I
would check out the following MS KB article to see if it applies:

PRB: Microsoft Access Database Connectivity Fails in Active Server Pages
http://support.microsoft.com/default.aspx?scid=kb;en-us;253604&Product=asp


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top