 |
| 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
|
|
|
|

September 27th, 2009, 05:42 AM
|
|
Registered User
|
|
Join Date: Sep 2009
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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?
|
|

September 27th, 2009, 05:48 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|
|

September 27th, 2009, 09:27 PM
|
|
Registered User
|
|
Join Date: Sep 2009
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks for reply. Here again i want to know that how can be granted IUSR acount in connection string
|
|

September 28th, 2009, 03:08 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Did you read the article I linked to?
Imar
|
|

September 29th, 2009, 01:13 AM
|
|
Registered User
|
|
Join Date: Sep 2009
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
|

September 29th, 2009, 06:20 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|
|
 |