?
Solved

Drivers error '80004005'

Posted on 1998-10-14
5
Medium Priority
?
214 Views
Last Modified: 2013-12-25
Hi

After I have added a DataCommandControl to my ASP file using Visual InterDev 6, I get the following error when I try to view it with the broswer:
 
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
/webforms_Local/formSysDSN.asp, line 31

I am trying to create a file DSN to an Access database.  The file DSN is already created with the ODBC and a data connection is created in the global.asa file.  However, I am not sure how to access it from the ASP using VID6.  Can you tell me if there is a certain sharing requirement that should be set up for the database or the folder where it resides.  Currently the database is in the "C:\InetPub\wwwroot\data" directory.


Also, is there a Data Form Wizard in VID6 that was available in VID1?

Please advise on the problem.
0
Comment
Question by:rick101396
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 1

Expert Comment

by:rajgn
ID: 1855709
For connecting to an Access database, we need not have a file DSN. We can do it dynamically in asp, provided you know the path of the .mdb file correctly. Assuming your .asp file is also in the same directory and it's the root directory of the web (i.e C:\InetPub\wwwroot\data), the following will be successful to make a connection to the database.

Set Conn = Server.CreateObject("ADODB.Connection")
cnpath="DBQ=" & server.mappath("\dbfile.mdb")
Conn.open "driver={Microsoft Access Driver (*.mdb)};" & cnpath

if the location of .asp or .mdb file changes, make changes accordingly to the second statement.
0
 

Author Comment

by:rick101396
ID: 1855710
How do I create a recordset after the connection is made? I tried the following code:

<%
Set Conn = Server.CreateObject("ADODB.Connection")
set cmd = server.CreateObject("ADODB.Command")
set rs=server.CreateObject("ADODB.Recordset")
cnpath= "DBQ=" & server.mappath(".\formpubs.mdb")
Conn.open "DRIVER={Microsoft Access Driver (*.mdb)};" & cnpath
cmd.CommandText="Select * From EDC_Forms"
cmd.CommandType=1
set cmd.ActiveConnection=Conn
rs.Open cmd,,1,1
%>

And I've got the following error message:

Microsoft OLE DB Provider for ODBC Drivers error '80040e21'
The request properties can not be supported by this ODBC Driver.
/forms/forms.asp, line 20

Please advise.
0
 

Author Comment

by:rick101396
ID: 1855711
How do I create a recordset after the connection is made? I tried the following code:

<%
Set Conn = Server.CreateObject("ADODB.Connection")
set cmd = server.CreateObject("ADODB.Command")
set rs=server.CreateObject("ADODB.Recordset")
cnpath= "DBQ=" & server.mappath(".\formpubs.mdb")
Conn.open "DRIVER={Microsoft Access Driver (*.mdb)};" & cnpath
cmd.CommandText="Select * From EDC_Forms"
cmd.CommandType=1
set cmd.ActiveConnection=Conn
rs.Open cmd,,1,1
%>

And I've got the following error message:

Microsoft OLE DB Provider for ODBC Drivers error '80040e21'
The request properties can not be supported by this ODBC Driver.
/forms/forms.asp, line 20

Please advise.
0
 
LVL 10

Accepted Solution

by:
MasseyM earned 800 total points
ID: 1855712
<%
    Set conn = Server.CreateObject("ADODB.Connection")
    conn.open "YourDSN","",""
    Set Session("YourDSN_conn") = conn
%>
<%
    sql = "SELECT  * From EDC_Forms"
    Set rs = Server.CreateObject("ADODB.Recordset")
    rs.Open sql, conn, 3, 3
%>

P.S. I would recommend that you have the DSN preset in Windows rather thn creating it dynamically... takes us less memory and time.

Also, you were trying to do too much to connect... This is a very simple process...
0
 

Author Comment

by:rick101396
ID: 1855713
Thanks for the tip.

I just wanted to make sure...The script above can also be used as a DSN-less connection right?  

You are right, the procedure to connect is very simple, but my program for some reason is not creating the proper script.  I keep on having errors after another.  Thanks again.
0

Featured Post

Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question