MS SQL 2005 Issues
Discussion
Hello all, i've just moved our sites onto a new server, and have set up MSSQL 2005 express, i've moved the databases across and can manage them fine through SQL Management program thingy, but when trying to access my sites it's coming up with the following error:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.
/includes/environment.asp, line 6
line 6 is the execution of a Select statement, the first interaction with the database. now I've checked the following:
username, password and databse name are the same
tcp/ip connections are enabled
the mdf files and folders are enabled full access for iusr
I can even log in using SQL authentication in the management program and access the database, just not through IIS. any ideas?
Thanks
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.
/includes/environment.asp, line 6
line 6 is the execution of a Select statement, the first interaction with the database. now I've checked the following:
username, password and databse name are the same
tcp/ip connections are enabled
the mdf files and folders are enabled full access for iusr
I can even log in using SQL authentication in the management program and access the database, just not through IIS. any ideas?
Thanks
DBNETLIB ????
And why are you using the generic OLEDB for ODBC with MS SQL Server when you can use the direct OLE DB driver?
Been a fair while since this was my stock in trade but I can remember a bit... sounds to me like your network client is confused and doesn't know what it's talking to (in this case, SQL2005) - get the ASP app server database client working properly first, i.e. connect to the database from the box running IIS (you're not running both on the same box, right?) and try to use the best driver. If you're exclusively using MS SQL Server then use their drivers... waste of time using OLEDB for ODBC when Microsoft provide a readymade OLE DB driver for their database, which is both more stable and more feature-rich...
And why are you using the generic OLEDB for ODBC with MS SQL Server when you can use the direct OLE DB driver?
Been a fair while since this was my stock in trade but I can remember a bit... sounds to me like your network client is confused and doesn't know what it's talking to (in this case, SQL2005) - get the ASP app server database client working properly first, i.e. connect to the database from the box running IIS (you're not running both on the same box, right?) and try to use the best driver. If you're exclusively using MS SQL Server then use their drivers... waste of time using OLEDB for ODBC when Microsoft provide a readymade OLE DB driver for their database, which is both more stable and more feature-rich...
MySQL has some weird fundamentals in allowing users access, is the ASP login from IIS coming from the same machine as the MySQL command prompt?
Perhaps check your mysql user table
make sure you have an entry in ther for the host and username you are using in ASP. (xxx'd out my ip in the table above)
Perhaps check your mysql user table
mysql> select host, user from mysql.user;
+-----------------------+------------------+
| host | user |
+-----------------------+------------------+
| % | network_analyser |
| % | root |
| 127.0.0.1 | root |
| xxx.xxx.xxx.xxx | root |
| localhost | network_analyser |
| localhost | root |
| localhost.localdomain | root |
+-----------------------+------------------+
make sure you have an entry in ther for the host and username you are using in ASP. (xxx'd out my ip in the table above)
mystomachehurts said:
cyberface said:
stuff
evenin fella 

fto2tuscan said:
they're running on the same box.
my connection string is:
'Connection String
sDBCnx = "Driver={SQL Server};Server="&sDBS&";Database="&sDBN&";UID="&sDBU&";PWD="&sDBP&";"
i haven't changed the code whatsoever, just the box. same version of mssql as well :S
Eh? Worked fine before on the same DBMS, right? I won't lecture about running IIS and MSSQL on the same box - but if the web server is on the same box as the database server, then the installation of the database server should have installed the latest version of MDAC which contains the drivers. As a result you should be good with the previous ADO connection string (which isn't optimal, it's an old-style ODBC connection string, which is why you end up using ODBC rather than Microsoft's own OLE DB driver for SQL Server)...my connection string is:
'Connection String
sDBCnx = "Driver={SQL Server};Server="&sDBS&";Database="&sDBN&";UID="&sDBU&";PWD="&sDBP&";"
i haven't changed the code whatsoever, just the box. same version of mssql as well :S
My gut reaction is to fix the connection string, which looks duff to me. But if you've got previously working code then prudent IT management is to *not* change code, but to ensure that your new environment is the same. I presume you're not the DBA, so get them to build your server properly

Or use a connection string like this (old code from me years ago, there may be better SQL OLE DB connection strings now... haven't cut code like this for years).....
provider=SQLOLEDB;data source=server_smb_name;initial catalog=database_name;integrated security=SSPI
This uses local security ID which will work since both IIS and SQL Server on the same box will be running as admin rights unless you've done it properly (sorry, seen too many duff Windows server installs). Otherwise you have to get rid of the 'integrated security' clause and throw in 'user' and 'password' clauses.

m12_nathan said:
Named instance of SQL? If so have you changed the server parameter in the code to server\instancename rather than just servername if it wasn't previously configured that way?
BINGO! i figured that out about 5 minutes before your post, but lesson in future, ask the PH massive earlier!!!! Thank you very very much nathan! fto2tuscan said:
must be something new though - you could previously always call it without the instance name?
Only if it's the only instance on the box or config says so. If you've moved to a new server there may be other instances running, in which case it's target port dependent / instance name (as Nathan pointed out). You can use Client Network utility (IIRC) to give a particular instance / port a specific name that you can address in your connection string IIRC, it's been a while since I've done this but I remember the aggro the multiple SQL instances caused to the devs who forgot about the new feature...Gassing Station | Computers, Gadgets & Stuff | Top of Page | What's New | My Stuff




