Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_database_setup thread: System DNS


Message #1 by "Barbara Rader" <rader@s...> on Sat, 14 Jul 2001 13:51:45 -0700
I am having trouble creating a system DNS.  I can't find the Trusted

Connection box that is not to be checked if I put the SQL Server Database

connection string in the Global.asa.  If I put the connection string in an

ASP file, I get an error message saying that I am not trusted to connect to

the database.  I have tried every method that I can find to connect to my

database through ASP on a IIS web server.  Here is one attempt.



I would appreciate some help.



Thank you, Barbara



<%

Option Explicit

%>

<!-- #include file='Includes/adovbs.inc' -->

<html>

<head>

	<title>Database Access Example</title>

</head>

<body>

<%

Dim strConnect

strConnect="Driver={SQL Server}; Server=BLACKWIDOWWEB/BLACKWIDOW;

Database=pubs; UID=; PWD="



Dim objConn, objRS



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

objConn.Open strConnect



objRS = Server.CreateObject("ADODB.Recordset")

objRS.Open "pubs", objConn, adOpenForwardOnly, adLockReadOnly, adCmdTable



Set strSQL = Connect.Execute("SELECT * FROM employee ORDER BY Date")



do until strSQL.EOF %>



ColumnLabel1: <%=strSQL("Emp_id")%>



<% strSQL.MoveNext

loop %>



<%

objRS.Close

objConn.Close

Set objRS = Nothing

Set objConn = Nothing

%>



</body>

</html>







Message #2 by kumars@i... on Sun, 15 Jul 2001 00:00:44
Hi, why do you want to use a DSN connection? You shouldnt really as they 

are twice as slow as an OLEDB connection, Heres an example for you, you 

should use paths, not dsn!! :)



---------



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

db.Open "Provider=SQLOLEDB; Data Source=SERVER; Initial Catalog=database; 

User ID=username; Password=password"



----------





Dont use the below





strConnect="Driver={SQL Server}; Server=BLACKWIDOWWEB/BLACKWIDOW;

Database=pubs; UID=; PWD="



Regards



Sunil



Message #3 by "Ken Schaefer" <ken@a...> on Mon, 16 Jul 2001 11:49:54 +1000
Barbara,



a) Does the SQL Server accept SQL Logins? If it only accepts trusted

connections then you are stuck using trusted connections. Give the anonymous

user a login to the database, and appropriate permissions.



b) Why are you using a DSN? Use a trusted connection and the OLEDB Provider

instead.



Cheers

Ken



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

From: "Barbara Rader" <rader@s...>

To: "ASP Database Setup" <asp_database_setup@p...>

Sent: Sunday, July 15, 2001 6:51 AM

Subject: [asp_database_setup] System DNS





: I am having trouble creating a system DNS.  I can't find the Trusted

: Connection box that is not to be checked if I put the SQL Server Database

: connection string in the Global.asa.  If I put the connection string in an

: ASP file, I get an error message saying that I am not trusted to connect

to

: the database.  I have tried every method that I can find to connect to my

: database through ASP on a IIS web server.  Here is one attempt.

:

: I would appreciate some help.





Message #4 by "Barbara Rader" <rader@s...> on Sun, 15 Jul 2001 08:34:40 -0700
I can't get your example to work.  What do I substitute into the example:



1. Do I put the server name (BLACKWIDOWWEB/BLACKWIDOW) instead of SERVER?



2. Do I put the database name instead of database (ie pubs)?



3. Is username the login name?



4. Is the password the login password?



The reason I was trying to use a DSN connection is because I can't get any

other method of connecting to work.  I have spent dozens of hours trying to

resolve this problem.



Thanks for the help, Barbara



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

From: kumars@i... [mailto:kumars@i...]

Sent: Sunday, July 15, 2001 12:01 AM

To: ASP Database Setup

Subject: [asp_database_setup] Re: System DNS





Hi, why do you want to use a DSN connection? You shouldnt really as they

are twice as slow as an OLEDB connection, Heres an example for you, you

should use paths, not dsn!! :)



---------



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

db.Open "Provider=SQLOLEDB; Data Source=SERVER; Initial Catalog=database;

User ID=username; Password=password"



----------





Dont use the below





strConnect="Driver={SQL Server}; Server=BLACKWIDOWWEB/BLACKWIDOW;

Database=pubs; UID=; PWD="



Regards



Sunil









Message #5 by "Ken Schaefer" <ken@a...> on Mon, 16 Jul 2001 18:14:25 +1000
Barbara,



If you want examples of SQL Server connection strings, look here:

http://www.able-consulting.com/ADO_Conn.htm#OLEDBProviderForSQLServer



the second one is the string for a trusted connection.



Cheers

Ken



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

From: "Barbara Rader" <rader@s...>

To: "ASP Database Setup" <asp_database_setup@p...>

Sent: Monday, July 16, 2001 1:34 AM

Subject: [asp_database_setup] Re: System DNS





: I can't get your example to work.  What do I substitute into the example:

:

: 1. Do I put the server name (BLACKWIDOWWEB/BLACKWIDOW) instead of SERVER?

:

: 2. Do I put the database name instead of database (ie pubs)?

:

: 3. Is username the login name?

:

: 4. Is the password the login password?

:

: The reason I was trying to use a DSN connection is because I can't get any

: other method of connecting to work.  I have spent dozens of hours trying

to

: resolve this problem.

:

: Thanks for the help, Barbara

:

: -----Original Message-----

: From: kumars@i... [mailto:kumars@i...]

: Sent: Sunday, July 15, 2001 12:01 AM

: To: ASP Database Setup

: Subject: [asp_database_setup] Re: System DNS

:

:

: Hi, why do you want to use a DSN connection? You shouldnt really as they

: are twice as slow as an OLEDB connection, Heres an example for you, you

: should use paths, not dsn!! :)

:

: ---------

:

: Set db = Server.CreateObject("ADODB.Connection")

: db.Open "Provider=SQLOLEDB; Data Source=SERVER; Initial Catalog=database;

: User ID=username; Password=password"

:

: ----------

:

:

: Dont use the below

:

:

: strConnect="Driver={SQL Server}; Server=BLACKWIDOWWEB/BLACKWIDOW;

: Database=pubs; UID=; PWD="

:

: Regards

:

: Sunil

:

:

:

:

:

: ---

: Search the best ASP Web sites using CodeHound! http://www.codehound.com

: Now it's easy to find ASP source code on the Internet. CodeHound's free

: search engine will categorize your results and even search for ASP code

: compressed in Zip files on the Internet.  Stop searching dozens of

: different sites to find what you want...try CodeHound right now!



ken@a...


$subst('Email.Unsub')




  Return to Index