Wrox Programmer Forums
|
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 Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 27th, 2009, 05:42 AM
Registered User
 
Join Date: Sep 2009
Posts: 8
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?
 
Old September 27th, 2009, 05:48 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 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
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old September 27th, 2009, 09:27 PM
Registered User
 
Join Date: Sep 2009
Posts: 8
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
 
Old September 28th, 2009, 03:08 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Did you read the article I linked to?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old September 29th, 2009, 01:13 AM
Registered User
 
Join Date: Sep 2009
Posts: 8
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.
 
Old September 29th, 2009, 06:20 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 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
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.