question

n3w2sql avatar image
n3w2sql asked

Connecting a SQL table to asp

First appologies if this has been asked before but cant find what I need. I am trying to show some SQL table information on my asp page buty I am unsure how to do this any help would be great as ive spend quite a while trying to do this now. my connection is ConnStr= Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=ASPdb;Data Source=test I want to do a SELECT * FROM tableA (just want to show everything in the table on my ASP page as its a small table) Thanks
sqlconnection-stringasp
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Grant Fritchey avatar image
Grant Fritchey answered
There is a lot of documentation on this type of fundamental action at Microsoft. I'd suggest going there to begin to understand how to program this type of connection. [Here is one example.][1] [1]: http://support.microsoft.com/kb/300488/pl
4 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Grant Fritchey avatar image Grant Fritchey ♦♦ commented ·
You have to remember that your login is probably not the context that your web site is running under. Your web site has to be able to log into SQL Server too. For help with the connection string, try using an online connection string builder. Here's one: http://www.developerfusion.com/tools/sql-connection-string/
1 Like 1 ·
n3w2sql avatar image n3w2sql commented ·
Thank you Grant but I am still having problems trying to connect as I am getting the following error Microsoft OLE DB Provider for SQL Server error '80040e4d'Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. the ConnStr ="Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=ASPdb;Data Source=test;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=WS01;Use Encryption for Data=False;Tag with column collation when possible=False" Any ideas would be very helpful. Thanks
0 Likes 0 ·
Grant Fritchey avatar image Grant Fritchey ♦♦ commented ·
Sounds like you don't have permission to the database. Make sure whatever AD context the app runs under can connect to the server.
0 Likes 0 ·
n3w2sql avatar image n3w2sql commented ·
Could there be another reason for this as I can connect to the database within SQL server using windows authentication, its the connection string that I think i have written incorrectly? I will look into the permissions just to be certain but seems strange as I can access the SQL server database through Access also.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.