First of all, I know absolutely nothing about connecting Access databases. However, I know a tad bit of VB.NET (my site is written in ASP, though). I need some help connecting to the DB. Here’s the script I’m currently using (I removed the database, account name and site name for security):
<%@ Language=VBScript %>
<% OPTION EXPLICIT %>
<%
Dim oConn
on error resume next
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & "D:\hshome\accountname\removed\removed.mdb"
If Err.Number <> 0 Then
%>
<html>
<head>
<title>Error</title>
<!-- #INCLUDE VIRTUAL="includes/style.css" -->
</head>
<body background="images/bg3.jpg" bgcolor="#000000" text="#C0C0C0">
<p align="center"><br> <br> <br> <br> <br> <br><font class="x" color="#FF0000"><b>Error accessing Database.</font><br> <br><font class="l" color="#FF0000">It may be being updated.<br> <br>Please retry in a few minutes.</b></font></p>
</body>
</html>
<%
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = -1
on error goto 0
Response.Flush
Response.End
end if
on error goto 0
%>
removed.mdb is in that directory. However, I’m getting the error message specified by the script. What exactly do I need to do to make this connection work? Please provide the exact code, as I don’t know what I’m doing with Access connections.
Set oConn = Server.CreateObject(“ADODB.Connection”)
oConn.Open “Provider=Microsoft.Jet.OLEDB.4.0;Data Source=” & “D:\hshome\accountname\removed\removed.mdb”
[/QUOTE]
Why are you using the &?
Just use:
Set oConn = Server.CreateObject(“ADODB.Connection”)
oConn.Open “Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\hshome\accountname\removed\removed.mdb;”
almost same type of problem as skyrider but asp with javascript
problems with cat.ActiveConnection = MM_tryout_STRING; coming back as
Microsoft OLE DB Provider for ODBC Drivers error ‘80004005’
[Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key ‘Temporary (volatile) Jet DSN for process 0x424c Thread 0x502c DBC 0x1536b024 Jet’.
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<%
var MM_tryout_STRING = "Driver={Microsoft Access Driver (*.mdb)};DBQ=D:\hshome\accountname\database\site2.mdb"
%>
<%
var cat = Server.CreateObject("ADODB.Recordset");
cat.ActiveConnection = MM_tryout_STRING;
cat.Source = "SELECT * FROM cat";
cat.CursorType = 0;
cat.CursorLocation = 2;
cat.LockType = 1;
cat.Open();
var cat_numRows = 0;
%>
i have tried
“DSN=accountname_xxxx” and get general 80004005 errors
other errors trying different combinations of paths/strings
[Microsoft][ODBC Microsoft Access Driver] Could not find file ‘(unknown)’.
folder / database file have full access to all from ftp app.
the same file will work locally using iis and local dsn or using same type of custom string above.
No, trial doesn’t have anything to do with it, but a number of items do. One is of course proper paths, another is that if the available quota is in use, it won’t work. You would be best to send a ticket with the domain and we can check it out.
dreamweaver will need to work out what is going on with it.
using “dynamic ASP / javascript” as new file option. and then filling out database and recordsets etc… with the wizards. the wizards themselves are not setting var for needed variables for the database code. X(
switching over to “dynamic ASP / VBscript” the wizards do create the needed dim’s in this case for the database code to work.