p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Databases
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.

Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 27th, 2009, 06:42 AM
Registered User
Points: 21, Level: 1
Points: 21, Level: 1 Points: 21, Level: 1 Points: 21, Level: 1
Activity: 2%
Activity: 2% Activity: 2% Activity: 2%
 
Join Date: Sep 2009
Location: Lucknow, UP
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Connection String to connect sql database

When a file RECORD_HOME.asp is run from IIS 5.1 server (localhost) with folowing code to connect sql database

set con=Server.CreateObject("ADODB.Connection")
con.open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Record;Data Source=Home-PC\sqlinst"

the IE 6.0 displays the following error
-------------------------------------------------------
Technical Information (for support personnel)

Error Type:
Microsoft OLE DB Provider for SQL Server (0x80040E4D)
Login failed for user 'HOME-PC\IUSR_HOME-PC'.
/sk/RECORD_HOME.ASP, line 40
-------------------------------------------------------

Sql Instance- sqlinst
Server- Home-PC
Database Name- Record
Server Authentication mode- Wnindow Authentication

The file is stored in sk folder which is resides in wwwroot folder. The same connection string works fine in VB6 project. What will be exact the connection string?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old September 27th, 2009, 06:48 AM
Imar's Avatar
Wrox Author
Points: 33,554, Level: 80
Points: 33,554, Level: 80 Points: 33,554, Level: 80 Points: 33,554, Level: 80
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 10,228
Thanks: 7
Thanked 203 Times in 201 Posts
Default

Hi there,

By running with "Integrated Security=SSPI", the connection to the database is made in the context of the calling user. In a VB 6 application, that account is probably your own account which probably has access to the database. In an ASP application, the account used is the IUSR account. You can either grant the IUSR account access to the database, or use SQL authentication in your connection string.

For more details: http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=395

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004

Did this post help you? Click the button to show your appreciation!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old September 27th, 2009, 10:27 PM
Registered User
Points: 21, Level: 1
Points: 21, Level: 1 Points: 21, Level: 1 Points: 21, Level: 1
Activity: 2%
Activity: 2% Activity: 2% Activity: 2%
 
Join Date: Sep 2009
Location: Lucknow, UP
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for reply. Here again i want to know that how can be granted IUSR acount in connection string
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #4 (permalink)  
Old September 28th, 2009, 04:08 AM
Imar's Avatar
Wrox Author
Points: 33,554, Level: 80
Points: 33,554, Level: 80 Points: 33,554, Level: 80 Points: 33,554, Level: 80
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 10,228
Thanks: 7
Thanked 203 Times in 201 Posts
Default

Did you read the article I linked to?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004

Did this post help you? Click the button to show your appreciation!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #5 (permalink)  
Old September 29th, 2009, 02:13 AM
Registered User
Points: 21, Level: 1
Points: 21, Level: 1 Points: 21, Level: 1 Points: 21, Level: 1
Activity: 2%
Activity: 2% Activity: 2% Activity: 2%
 
Join Date: Sep 2009
Location: Lucknow, UP
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I read and found the solution. Thanks for guidence. one more thing i want to know that what will be appropriate data type to store text of length>20000 characters in sql database (memo type in Access database). In sql server database text and varchar data type allows only up to 8000 characters.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #6 (permalink)  
Old September 29th, 2009, 07:20 AM
Imar's Avatar
Wrox Author
Points: 33,554, Level: 80
Points: 33,554, Level: 80 Points: 33,554, Level: 80 Points: 33,554, Level: 80
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 10,228
Thanks: 7
Thanked 203 Times in 201 Posts
Default

Hi there,

That limit only applies to varchar / nvarchar, not to text / ntext. These data types allow up to 1 or 2 Gig of data.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004

Did this post help you? Click the button to show your appreciation!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Connect query w/ database(dao dsnless connection) omnicap1 Access VBA 0 August 23rd, 2004 02:50 PM
Connect query w/ database(dao dsnless connection) omnicap1 Access VBA 0 August 23rd, 2004 02:49 PM
Connect query w/ database(dao dsnless connection) omnicap1 Access VBA 0 August 23rd, 2004 02:48 PM
To connect Database with Connection Pool sudipta JSP Basics 0 June 8th, 2004 03:03 AM
connection string to MSDE(SQL) database from ASP johngilbart BOOK: Beginning ASP 3.0 9 June 13th, 2003 07:09 PM



All times are GMT -4. The time now is 02:27 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc