Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

debug ADO error 1

Status
Not open for further replies.

achai

MIS
May 23, 2000
71
US
error:<br>&quot;Microsoft OLE DB Provider for ODBC Drivers error '80040e4e' <br>Operation Canceled&quot;<br>----------------------------<br>code:<br>&lt;%<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set oConn = Server.CreateObject(&quot;ADODB.Connection&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set oRs = Server.CreateObject(&quot;ADODB.Recordset&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oConn.Open &quot;driver=Microsoft Access Driver (*.mdb);SERVER=PWS;database=quickstore;USERID=;PASSWORD=;&quot;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strSQL = &quot;SELECT * FROM customers order BY customerID&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set oRs = oConn.Execute(strSQL)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Do While Not oRs.EOF<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Response.Write &quot;&lt;OPTION&gt;&quot; & oRs.Fields(&quot;firstname&quot;) & &quot;&lt;/OPTION&gt;&quot; & vbcrlf<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oRs.MoveNext<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Loop<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set oRs = Nothing<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set oConn = Nothing<br>&nbsp;&nbsp;&nbsp;%&gt;<br>----------------------------<br>explain:<br>I use PWS, i use ODBC data source administrator to connect datasource.<br>error seems i don't have ADO. <br>
 
&gt; i use ODBC data source administrator to connect datasource.<br><br>If that is true then your connection.Open call should look somthing like this:<br><br>oConn.Open &quot;DSN=MyDsn;&quot;<br><br>Good luck<br>-pete
 
i change to <br>---------<br>oConn.Open &quot;dsn=quickstore;driver=Microsoft Access Driver (*.mdb);SERVER=PWS;database=quickstore;USERID=;PASSWORD=;&quot;<br><br>It works. thanks. <br>can you explain why?
 
&gt; can you explain why? <br><br>Because that is the purpose of the DSN entry in the ODBC Manager, to provide the connection information.<br><br>Actually it should work just as I posted it:<br><br>oConn.Open &quot;dsn=quickstore;&quot;<br><br>if your DSN entry is setup correctly.<br><br>-pete
 
thank for explaination.<br><br>but why others use <br>oConn.Open &quot;driver=bla,bla;SERVER=bla;database=bla;USERID=;PASSWORD=;&quot;<br>to connect the database? they don't use ODBC manager?<br><br>
 
the method you desribe in your last post is generally used for OLEDB access, not ODBC.<br> <p>nick bulka<br><a href=mailto: > </a><br><a href= > </a><br>
 
A quick rundown of three ways to connect to a database<br><br>1.&nbsp;&nbsp;ODBC Manager<br>Enter all configuration information through the ODBC manager and the ODBC driver.&nbsp;&nbsp;Connect to your database like this:<br><br><FONT FACE=monospace>&quot;DSN=Northwind;&quot;</font><br><br>2. DSN-less ODBC connection<br>Script the same information, connect with the ODBC driver but don't need to set up a system level DSN.<br><br>SQL Server connection string looks like this:<br><FONT FACE=monospace>&quot;Driver={SQL Server}; Server=(local); Database=Northwind; UID=sa; PWD=;&quot;</font><br><br>Access connection string looks like this:<br><FONT FACE=monospace>&quot;Driver={Microsoft Access Driver (*.mdb)}; DBQ=C:\Temp\Northwind.mdb&quot;</font><br><br>3. DSN-less OLEDB connection<br>Script similar information but use the OLEDB native driver.<br><br>SQL Server Connection string looks like this:<br><FONT FACE=monospace>&quot;Provider=SQLOLEDB; Data_Source=(local); Initial Catalog=Northwind; User Id=sa; Password=;&quot;</font><br><br>Access connection string looks like this;<br><FONT FACE=monospace>&quot;Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Temp\Northwind.mdb&quot;</font><br><br>---------------------<br><br>So what are the differences?&nbsp;&nbsp;Well, it helps if you understand how ODBC is used.&nbsp;&nbsp;ODBC is a vendor independent layer between your applications and the databases.&nbsp;&nbsp;OLEDB is a Microsoft specific layer between your application and the database.&nbsp;&nbsp;When ADO connects to your database through ODBC, it actually goes ADO -&gt; ODBC -&gt; OLEDB -&gt; Database.<br><br>So what does all this mean?<br>1. Using a DSN-less OLEDB connection is going to give you faster access because you don't have to go through the ODBC driver.&nbsp;&nbsp;(ADO -&gt; OLEDB -&gt; Database)<br><br>2. If your ISP charges you to set up a DSN, using a DSN-less connection will save you a few bucks.<br><br>3. Moving applications between machines is a breeze with a DSN-less connection because you don't have to remember to set up ODBC DSNs on multiple systems.<br><br>4. A DSN-less connection is potentially less secure because your DB password is scripted in your page.&nbsp;&nbsp;If someone has access to your ASP source code, they have access to your database password.<br><br>That't the gist of it.&nbsp;&nbsp;Hope this helps. <p> Jeff Friestman<br><a href=mailto: > </a><br><a href= View my Brainbench transcript</a><br>Brainbench 'Most Valuable Professional' for ASP<br>
Brainbench 'Most Valuable Professional' for JavaScript<br>
 
i use ODBC administrator to connect informix database.<br>---------<br>error:<br><br>Microsoft OLE DB Provider for ODBC Drivers error '80004005' <br><br>[MERANT][ODBC Informix driver]Insufficient information to connect to the data source. <br>---------<br>code:<br>&lt;%<br>set oconn=server.createobject(&quot;adodb.connection&quot;)<br>set oRs = Server.CreateObject(&quot;ADODB.Recordset&quot;)<br>oConn.Open &quot;dsn=informix;driver={MERANT 3.60 32-BIT INFORMIX};server=DEV0_TCP;database=informix;&quot;<br>strSQL = &quot;SELECT * FROM user_type&quot;<br>.............
 
Your connection string looks like a witches brew of parameters.<br><br>1. Where's your username and password in the connection string?<br><br>2. Why are you putting the driver and the DSN in the same connection string?&nbsp;&nbsp;If you've already set up DSN, you shouldn't need to also specify a driver.<br><br>3. You connection string:database=Informix?&nbsp;&nbsp;Are you sure?&nbsp;&nbsp;Your RDBMS is informix but your database probably isn't named informix.<br><br>I don't think there is a native OLEDB driver for informix so look at my previous post and set up your DSN-less connection using the ODBC syntax I describe.<br><br> <p> Jeff Friestman<br><a href=mailto: > </a><br><a href= View my Brainbench transcript</a><br>Brainbench 'Most Valuable Professional' for ASP<br>
Brainbench 'Most Valuable Professional' for JavaScript<br>
 
I changed <br>oConn.Open &quot;dsn=informix;driver={MERANT 3.60 32-BIT INFORMIX};server=DEV0_TCP;database=informix;&quot;<br>to <br>oConn.Open &quot;dsn=informix;&quot;<br>now it works very well.<br>thanks. I didn't notice the explaination you wrote ealier. it exactly answers my question.<br><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top