Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > ADOBD execute problem

Reply
Thread Tools

ADOBD execute problem

 
 
Baba
Guest
Posts: n/a
 
      07-02-2008
Hi,
using ADODB in ASP pages we have this strange problem.

If we create an ADODB connection specifying the DNS server name instead of
IP server address, then sometimes, during call to Execute method we get this
error:

[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or
access denied.

The code looks simply like:

<%
Dim cn, rst

Set cn = Server.CreateObject("ADODB.Connection")
cn.ConnectionString = "Driver={SQL Server};Server=sql.acme.com;Initial
Catalog=SomeDB;User Id=...;Password=..."
cn.Open

Set rst = cn.Execute("SELECT * FROM SomeTableWHERE ...")
....

rst.Close
Set rst = Nothing

cn.Close
Set cn = Nothing

%>

In my opinion, the strange things are:

1) No problem appears if we specify IP Server address
2) The problem is on the Execute and not on the cn.Open()
3) The problema appears sometimes

We tried to add a line to hosts file too, to avoid use of resolver (in the
hypotesys of name server problems) but nothing changed: the error still
happens randomly.

Unluckly, now we have to use the server name instead of IPAddress for the
cohexistence of web and windows application from inside/outside LAN area.

Thank you in advance.


 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      07-02-2008
Baba wrote:
> Hi,
> using ADODB in ASP pages we have this strange problem.
>
> If we create an ADODB connection specifying the DNS server name
> instead of IP server address, then sometimes, during call to Execute
> method we get this error:
>
> [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not
> exist or access denied.
>
> The code looks simply like:
>
> <%
> Dim cn, rst
>
> Set cn = Server.CreateObject("ADODB.Connection")
> cn.ConnectionString = "Driver={SQL Server};Server=sql.acme.com;Initial
> Catalog=SomeDB;User Id=...;Password=..."


It sounds as if you have some network issues. However, you should use the
native OLE DB provider for SQL Server rather than the obsolete ODBC
provider. See the section about SQL Server OLE DB connections at
www.connectionstrings.com

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


 
Reply With Quote
 
 
 
 
Dave Anderson
Guest
Posts: n/a
 
      07-02-2008
Baba wrote:
> Hi,
> using ADODB in ASP pages we have this strange problem.
>
> If we create an ADODB connection specifying the DNS server name
> instead of IP server address, then sometimes, during call to Execute
> method we get this error:
>
> [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not
> exist or access denied.


Like Bob says, use OLEDB. Then force TCP/IP instead of named pipes by
specifying the network library:
http://www.connectionstrings.com/art...kprotocoltouse

In general, this is very useful:
http://www.connectionstrings.com/?carrier=sqlserver



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in httphandler using server.execute(please urgent) sathya ASP .Net 1 06-16-2005 12:24 PM
Execute problem with JCreator Mark K Java 13 11-10-2004 05:09 PM
Can i execute aspx file in my asp pag with server.execute method(sorry) Savas Ates ASP General 1 08-17-2004 04:52 PM
Show stopper problem!! Parser Error Message: Execute permission cannot be acquired David Berman ASP .Net 0 06-22-2004 08:37 PM
problem with $dbh->execute in a For loop Ravi Perl 6 10-01-2003 05:15 PM



Advertisments