Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Connection to Sybase database using ASP - Need help


Message #1 by klbond@n... on Wed, 20 Feb 2002 19:30:03
Hello,



I've tried several code examples to connect to a sybase database using asp 

and nothing's working.  I think I need to define Username and Password but 

can't get that code to work either.

Can someone please tell me what's needed and how to properly code Username 

and Password, please?



Thanks,  Kathy



Here's the first attempt showing the error message, followed by the two 

asp files used:



Microsoft OLE DB Provider for ODBC Drivers error '80004005' 



[INTERSOLV][ODBC SQL Server driver]Insufficient information to connect to 

the data source.

/test/dbconn.asp, line 5 





This is conntest.asp:



<% @language=vbscript %>

<% Option Explicit %>



<!--#include file="dbconn.asp"-->



<%

sql = "select proj_no, proj_amt from project where proj_no = '000123'"

Set rs = dbConn.Execute(sql)

if not rs.EOF then

   response.write proj_no

end if

%>



This is dbconn.asp:



<%

Dim objConn

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

objConn.ConnectionString = "DSN=dbAcct"

objConn.Open

%>

Message #2 by "James Garrett" <jhgarrett@e...> on Wed, 20 Feb 2002 15:22:50 -0500
I got  the same error code when attempting to connect to SQL Server using

Javascript.  Might something be missing in the configuration of  IIS or some

other aspect of the server configuration.





----- Original Message -----

From: <klbond@n...>

To: "ASP Databases" <asp_databases@p...>

Sent: Wednesday, February 20, 2002 7:30 PM

Subject: [asp_databases] Connection to Sybase database using ASP - Need help





> Hello,

>

> I've tried several code examples to connect to a sybase database using asp

> and nothing's working.  I think I need to define Username and Password but

> can't get that code to work either.

> Can someone please tell me what's needed and how to properly code Username

> and Password, please?

>

> Thanks,  Kathy

>

> Here's the first attempt showing the error message, followed by the two

> asp files used:

>

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

>

> [INTERSOLV][ODBC SQL Server driver]Insufficient information to connect to

> the data source.

> /test/dbconn.asp, line 5

>

>

> This is conntest.asp:

>

> <% @language=vbscript %>

> <% Option Explicit %>

>

> <!--#include file="dbconn.asp"-->

>

> <%

> sql = "select proj_no, proj_amt from project where proj_no = '000123'"

> Set rs = dbConn.Execute(sql)

> if not rs.EOF then

>    response.write proj_no

> end if

> %>

>

> This is dbconn.asp:

>

> <%

> Dim objConn

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

> objConn.ConnectionString = "DSN=dbAcct"

> objConn.Open

> %>

>




$subst('Email.Unsub').



Message #3 by "Shripad_01" <shripad_01@y...> on Thu, 21 Feb 2002 10:41:55 +0530
try



<%

Dim objConn

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

objConn.ConnectionString = "DSN=dbAcct;uid=<your user id>;pwd=<password

here>"

objConn.Open

%>





----- Original Message -----

From: <klbond@n...>

To: "ASP Databases" <asp_databases@p...>

Sent: Wednesday, February 20, 2002 7:30 PM

Subject: [asp_databases] Connection to Sybase database using ASP - Need help





> Hello,

>

> I've tried several code examples to connect to a sybase database using asp

> and nothing's working.  I think I need to define Username and Password but

> can't get that code to work either.

> Can someone please tell me what's needed and how to properly code Username

> and Password, please?

>

> Thanks,  Kathy

>

> Here's the first attempt showing the error message, followed by the two

> asp files used:

>

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

>

> [INTERSOLV][ODBC SQL Server driver]Insufficient information to connect to

> the data source.

> /test/dbconn.asp, line 5

>

>

> This is conntest.asp:

>

> <% @language=vbscript %>

> <% Option Explicit %>

>

> <!--#include file="dbconn.asp"-->

>

> <%

> sql = "select proj_no, proj_amt from project where proj_no = '000123'"

> Set rs = dbConn.Execute(sql)

> if not rs.EOF then

>    response.write proj_no

> end if

> %>

>

> This is dbconn.asp:

>

> <%

> Dim objConn

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

> objConn.ConnectionString = "DSN=dbAcct"

> objConn.Open

> %>

>




$subst('Email.Unsub').







_________________________________________________________



Do You Yahoo!?



Get your free @yahoo.com address at http://mail.yahoo.com







Message #4 by klbond@n... on Thu, 21 Feb 2002 12:59:15
Everyone,



When I included uid and pwd in the connection string (and used the correct 

syntax), it works. 



Thanks,  Kat









> try

> 

> <%

> Dim objConn

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

> objConn.ConnectionString = "DSN=dbAcct;uid=<your user id>;pwd=<password

> here>"

> objConn.Open

> %>

> 

> 

> ----- Original Message -----

> From: <klbond@n...>

> To: "ASP Databases" <asp_databases@p...>

> Sent: Wednesday, February 20, 2002 7:30 PM

> Subject: [asp_databases] Connection to Sybase database using ASP - Need 

help

> 

> 

> > Hello,

> >

> > I've tried several code examples to connect to a sybase database using 

asp

> > and nothing's working.  I think I need to define Username and Password 

but

> > can't get that code to work either.

> > Can someone please tell me what's needed and how to properly code 

Username

> > and Password, please?

> >

> > Thanks,  Kathy

> >

> > Here's the first attempt showing the error message, followed by the two

> > asp files used:

> >

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

> >

> > [INTERSOLV][ODBC SQL Server driver]Insufficient information to connect 

to

> > the data source.

> > /test/dbconn.asp, line 5

> >

> >

> > This is conntest.asp:

> >

> > <% @language=vbscript %>

> > <% Option Explicit %>

> >

> > <!--#include file="dbconn.asp"-->

> >

> > <%

> > sql = "select proj_no, proj_amt from project where proj_no = '000123'"

> > Set rs = dbConn.Execute(sql)

> > if not rs.EOF then

> >    response.write proj_no

> > end if

> > %>

> >

> > This is dbconn.asp:

> >

> > <%

> > Dim objConn

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

> > objConn.ConnectionString = "DSN=dbAcct"

> > objConn.Open

> > %>

> >




> $subst('Email.Unsub').

> 

> 

> 

> _________________________________________________________

> 

> Do You Yahoo!?

> 

> Get your free @yahoo.com address at http://mail.yahoo.com

> 

> 

> 


  Return to Index