ADO vs DAO for Access Queries via ASP 
Author Message
 ADO vs DAO for Access Queries via ASP

Hi,
This is sort of a follow-up question to an earlier posted string on an error
message I'm receiving when trying to connect to an MS Access database using
an ASP script.

Is it possible to use DAO syntax in an active server page to connect to an
Access database, or do you have to use ADO syntax?  Although my ADO script
works on my desktop machine with PWS, I get an error message when trying to
access it after posting it to my Internet web site (I've checked an
rechecked all the paths and the ISP has reconfirmed the ODBC setup).

The ISP assures me all is well on their end - perhaps it's my scripting.
Anyone see anything wrong with the syntax or know of an alternate method to
make the connection?

-----------------------------
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC Microsoft Access 97 Driver] The Microsoft Jet database
engine cannot find the input table or query 'mdb'. Make sure it exists and
that its name is spelled correctly.

/AliasCheck.asp, line 24
-------------------------------

Here is the script fragment from the AliasCheck.asp file:

----------------------------------------------
<%

Set objConnection = Server.CreateObject("ADODB.Connection")

objConnection.Open "AliasDataBase"

SQLQuery = "SELECT Alias, Domain FROM
c\:Apps\Websrvr\WebSite\htdocs\diplomats\htdocs\_private\alias"

Set rsAliasList = objConnection.Execute(SQLQuery)

%>
----------------------------------------------------

Thanks in advance for any assistance.
Bruce



Sun, 03 Jun 2001 03:00:00 GMT  
 ADO vs DAO for Access Queries via ASP
For a start c\: should be c:\ I think

Quote:

>Hi,
>This is sort of a follow-up question to an earlier posted string on an
error
>message I'm receiving when trying to connect to an MS Access database using
>an ASP script.

>Is it possible to use DAO syntax in an active server page to connect to an
>Access database, or do you have to use ADO syntax?  Although my ADO script
>works on my desktop machine with PWS, I get an error message when trying to
>access it after posting it to my Internet web site (I've checked an
>rechecked all the paths and the ISP has reconfirmed the ODBC setup).

>The ISP assures me all is well on their end - perhaps it's my scripting.
>Anyone see anything wrong with the syntax or know of an alternate method to
>make the connection?

>-----------------------------
>Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

>[Microsoft][ODBC Microsoft Access 97 Driver] The Microsoft Jet database
>engine cannot find the input table or query 'mdb'. Make sure it exists and
>that its name is spelled correctly.

>/AliasCheck.asp, line 24
>-------------------------------

>Here is the script fragment from the AliasCheck.asp file:

>----------------------------------------------
><%

>Set objConnection = Server.CreateObject("ADODB.Connection")

>objConnection.Open "AliasDataBase"

>SQLQuery = "SELECT Alias, Domain FROM
>c\:Apps\Websrvr\WebSite\htdocs\diplomats\htdocs\_private\alias"

>Set rsAliasList = objConnection.Execute(SQLQuery)

>%>
>----------------------------------------------------

>Thanks in advance for any assistance.
>Bruce



Mon, 04 Jun 2001 03:00:00 GMT  
 ADO vs DAO for Access Queries via ASP
Oops, that was a typo in my posting, not on the web site.  Here is what was
on the web site (also fixing a typo where I left off the .mdb):

c\:Apps\Websrvr\WebSite\htdocs\diplomats\htdocs\_private\alias.mdb

Also, someone noted that I don't need to use a path, just the file name
since the DSN knows where to find it.  So I took off the path, and now I get
the following error:

-------------
Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Microsoft Access 97 Driver] Couldn't find file
'C:\Apps\Websrvr\WebSite\alias.mdb'.

/AliasCheck.asp, line 24
------------------------

Note the directory where it was looking is not where the file is.  Could
this have something to do with how the virtual directory is mapped?

Bruce

Quote:

>For a start c\: should be c:\ I think


>>Hi,
>>This is sort of a follow-up question to an earlier posted string on an
>error
>>message I'm receiving when trying to connect to an MS Access database
using
>>an ASP script.

>>Is it possible to use DAO syntax in an active server page to connect to an
>>Access database, or do you have to use ADO syntax?  Although my ADO script
>>works on my desktop machine with PWS, I get an error message when trying
to
>>access it after posting it to my Internet web site (I've checked an
>>rechecked all the paths and the ISP has reconfirmed the ODBC setup).

>>The ISP assures me all is well on their end - perhaps it's my scripting.
>>Anyone see anything wrong with the syntax or know of an alternate method
to
>>make the connection?

>>-----------------------------
>>Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

>>[Microsoft][ODBC Microsoft Access 97 Driver] The Microsoft Jet database
>>engine cannot find the input table or query 'mdb'. Make sure it exists and
>>that its name is spelled correctly.

>>/AliasCheck.asp, line 24
>>-------------------------------

>>Here is the script fragment from the AliasCheck.asp file:

>>----------------------------------------------
>><%

>>Set objConnection = Server.CreateObject("ADODB.Connection")

>>objConnection.Open "AliasDataBase"

>>SQLQuery = "SELECT Alias, Domain FROM
>>c\:Apps\Websrvr\WebSite\htdocs\diplomats\htdocs\_private\alias"

>>Set rsAliasList = objConnection.Execute(SQLQuery)

>>%>
>>----------------------------------------------------

>>Thanks in advance for any assistance.
>>Bruce



Mon, 04 Jun 2001 03:00:00 GMT  
 ADO vs DAO for Access Queries via ASP


Quote:
> Is it possible to use DAO syntax in an active server page to connect to an
> Access database, or do you have to use ADO syntax?  Although my ADO script
> works on my desktop machine with PWS, I get an error message when trying to
> access it after posting it to my Internet web site (I've checked an
> rechecked all the paths and the ISP has reconfirmed the ODBC setup).

If you're using ADO, you must use ADO syntax. That is, if you use
CreateObject and create an ADO recordset, then you're using that syntax
throughout.  And you really, really don't want to use DAO from an ASP
page. ADO gives much better support for cursoring, is generally easier to
program, and requires less traffic. -- Ken


Mon, 04 Jun 2001 03:00:00 GMT  
 ADO vs DAO for Access Queries via ASP
why don't you use the "Server.MapPath("dbname") Statement to find the way to
your database. It always starts where your ASP page is located.
Steffen


Mon, 04 Jun 2001 03:00:00 GMT  
 ADO vs DAO for Access Queries via ASP
Bruce,
        The error probably comes from the location of where the ODBC entry
is pointing.  When using the from clause you really don't need the filename
at all, you just want the individual table names that exist inside the db
and don't need the db name.  The select should just be the fields or a * to
denote all.

        Hope this helps,
        Mark Fitzpatrick
        Microsoft MVP - FrontPage


Quote:
>Oops, that was a typo in my posting, not on the web site.  Here is what was
>on the web site (also fixing a typo where I left off the .mdb):

>c\:Apps\Websrvr\WebSite\htdocs\diplomats\htdocs\_private\alias.mdb

>Also, someone noted that I don't need to use a path, just the file name
>since the DSN knows where to find it.  So I took off the path, and now I
get
>the following error:

>-------------
>Microsoft OLE DB Provider for ODBC Drivers error '80004005'

>[Microsoft][ODBC Microsoft Access 97 Driver] Couldn't find file
>'C:\Apps\Websrvr\WebSite\alias.mdb'.

>/AliasCheck.asp, line 24
>------------------------

>Note the directory where it was looking is not where the file is.  Could
>this have something to do with how the virtual directory is mapped?

>Bruce


>>For a start c\: should be c:\ I think


>>>Hi,
>>>This is sort of a follow-up question to an earlier posted string on an
>>error
>>>message I'm receiving when trying to connect to an MS Access database
>using
>>>an ASP script.

>>>Is it possible to use DAO syntax in an active server page to connect to
an
>>>Access database, or do you have to use ADO syntax?  Although my ADO
script
>>>works on my desktop machine with PWS, I get an error message when trying
>to
>>>access it after posting it to my Internet web site (I've checked an
>>>rechecked all the paths and the ISP has reconfirmed the ODBC setup).

>>>The ISP assures me all is well on their end - perhaps it's my scripting.
>>>Anyone see anything wrong with the syntax or know of an alternate method
>to
>>>make the connection?

>>>-----------------------------
>>>Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

>>>[Microsoft][ODBC Microsoft Access 97 Driver] The Microsoft Jet database
>>>engine cannot find the input table or query 'mdb'. Make sure it exists
and
>>>that its name is spelled correctly.

>>>/AliasCheck.asp, line 24
>>>-------------------------------

>>>Here is the script fragment from the AliasCheck.asp file:

>>>----------------------------------------------
>>><%

>>>Set objConnection = Server.CreateObject("ADODB.Connection")

>>>objConnection.Open "AliasDataBase"

>>>SQLQuery = "SELECT Alias, Domain FROM
>>>c\:Apps\Websrvr\WebSite\htdocs\diplomats\htdocs\_private\alias"

>>>Set rsAliasList = objConnection.Execute(SQLQuery)

>>>%>
>>>----------------------------------------------------

>>>Thanks in advance for any assistance.
>>>Bruce



Mon, 04 Jun 2001 03:00:00 GMT  
 ADO vs DAO for Access Queries via ASP
Thanks everyone!  Your suggestions fixed my problem.  I left off the path
and the .mdb part of the file name (now that I understand that the 'table'
is different than the 'file') and all seems to work well.  Thanks again.

Bruce


Quote:
>Bruce,
>        The error probably comes from the location of where the ODBC entry
>is pointing.  When using the from clause you really don't need the filename
>at all, you just want the individual table names that exist inside the db
>and don't need the db name.  The select should just be the fields or a * to
>denote all.

>        Hope this helps,
>        Mark Fitzpatrick
>        Microsoft MVP - FrontPage



>>Oops, that was a typo in my posting, not on the web site.  Here is what
was
>>on the web site (also fixing a typo where I left off the .mdb):

>>c\:Apps\Websrvr\WebSite\htdocs\diplomats\htdocs\_private\alias.mdb

>>Also, someone noted that I don't need to use a path, just the file name
>>since the DSN knows where to find it.  So I took off the path, and now I
>get
>>the following error:

>>-------------
>>Microsoft OLE DB Provider for ODBC Drivers error '80004005'

>>[Microsoft][ODBC Microsoft Access 97 Driver] Couldn't find file
>>'C:\Apps\Websrvr\WebSite\alias.mdb'.

>>/AliasCheck.asp, line 24
>>------------------------

>>Note the directory where it was looking is not where the file is.  Could
>>this have something to do with how the virtual directory is mapped?

>>Bruce


>>>For a start c\: should be c:\ I think


>>>>Hi,
>>>>This is sort of a follow-up question to an earlier posted string on an
>>>error
>>>>message I'm receiving when trying to connect to an MS Access database
>>using
>>>>an ASP script.

>>>>Is it possible to use DAO syntax in an active server page to connect to
>an
>>>>Access database, or do you have to use ADO syntax?  Although my ADO
>script
>>>>works on my desktop machine with PWS, I get an error message when trying
>>to
>>>>access it after posting it to my Internet web site (I've checked an
>>>>rechecked all the paths and the ISP has reconfirmed the ODBC setup).

>>>>The ISP assures me all is well on their end - perhaps it's my scripting.
>>>>Anyone see anything wrong with the syntax or know of an alternate method
>>to
>>>>make the connection?

>>>>-----------------------------
>>>>Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

>>>>[Microsoft][ODBC Microsoft Access 97 Driver] The Microsoft Jet database
>>>>engine cannot find the input table or query 'mdb'. Make sure it exists
>and
>>>>that its name is spelled correctly.

>>>>/AliasCheck.asp, line 24
>>>>-------------------------------

>>>>Here is the script fragment from the AliasCheck.asp file:

>>>>----------------------------------------------
>>>><%

>>>>Set objConnection = Server.CreateObject("ADODB.Connection")

>>>>objConnection.Open "AliasDataBase"

>>>>SQLQuery = "SELECT Alias, Domain FROM
>>>>c\:Apps\Websrvr\WebSite\htdocs\diplomats\htdocs\_private\alias"

>>>>Set rsAliasList = objConnection.Execute(SQLQuery)

>>>>%>
>>>>----------------------------------------------------

>>>>Thanks in advance for any assistance.
>>>>Bruce



Mon, 04 Jun 2001 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. ADO vs DAO for Access Queries via ASP

2. Access Query with multiple params via ASP using ADO

3. ADO Recordsets and Forms (ADO vs DAO)

4. Using ADO Recordset with Forms (ADO vs DAO)

5. ADO vs DAO when creating queries in code

6. ADO vs DAO vs ADODB

7. DAO ADO Access vs Excel

8. ADO Vs. DAO and Access 2002

9. Access ADO vs. DAO

10. Connecting to Access via ASP - ADO/ODBC


 
Powered by phpBB® Forum Software © phpBB Group