Jump to content
  • Advertisement
Sign in to follow this  
Tiger99

Database Connection Problem

This topic is 5470 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi I am having some problem connecting to database using ASP. Here is my ODBC data source Name:DevDB, Driver: SQL Server Here is my code set conn2=Server.CreateObject("ADODB.Connection") conn2.Open "driver={SQL Server};DevDB" set rs2 = Server.CreateObject("ADODB.recordset") sql2 = "Select TITLE from v6 where TITLE Like '%wphoto%'" When I open the asp page, it just stalls Any idea? Thanks for your help

Share this post


Link to post
Share on other sites
Advertisement
Here is the error message that I am getting
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC SQL Server Driver]Neither DSN nor SERVER keyword supplied

Share this post


Link to post
Share on other sites
Is that a valid connection string? I admit I've never really played with ADO enough to see how far you can stretch it's ability to work with a minimal parameter string, but in your example you don't even specify what "DevDB" is supposed to be, its just a piece of text sitting there (normally you write "Database=DevDB"). In addition to that you aren't specifying the server the database is on (at least you would have 127.0.0.1, if not the actual name of the system) or a valid login (to be honest I've never tried setting up an SQL server without any login authentication, I'm not even sure if such a silly thing is even possible with any version released in the last half decade)

Share this post


Link to post
Share on other sites
Quote:
Original post by Tiger99
Here is the error message that I am getting
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC SQL Server Driver]Neither DSN nor SERVER keyword supplied


That's because you didn't specify a server at all. A DSN would be if you setup the connection in ODBC, in that case all you would need to do is specify the DSN name for your connection (an ODBC DSN connection is useful because the connection information is stored in one place for many potential clients, allowing you to change the server or even the underlying database without having to update all the clients)

Share this post


Link to post
Share on other sites
Thanks..now here is my code
conn2.Open "driver={SQL Server};server=SQL04YKF;DevDB;uid=aliu;password=Allen19"

and I am getting the following message when I open my asp page
Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.
Do I need to ask for a special permission?

Any idea?

Share this post


Link to post
Share on other sites
Thanks, I just modified the ODBC for SQL server code and here is what I have
conn2.Open "driver={SQL Server};Server=SQL04YKF;Trusted_Connection=no;Database=DevDB;Uid=aliu;Pwd=Allen19;"

now I am getting similar but different error message
Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'aliu'.

Does that mean that I don't have the permission?

Thanks

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!