Click to See Complete Forum and Search --> : using iis on local machine for testing
esthera
07-17-2005, 01:22 AM
I have installed iis on my local machine so that i can test.
When testing code that uses a db -- what should the connection string be if I am testing with a test mssql db on my local machine?
buntine
07-17-2005, 01:39 AM
There are alot of variables. I would be inclined to setup a DSN for MS SQL locally.
See www.connectionscripts.com for some details on the correct CS for you.
Here is an example:
Dim strConnString
strConnString = "Provider=SQLOLEDB;Data Source=An SQLServer or IP;Initial Catalog=Your Database Name;UID=A User;PWD=A Password"
Regards.
esthera
07-17-2005, 03:21 AM
the link you gave isn't working...
How do I know my ip? Also for local sql server -- I don't use a username and password --so any ideas on what the connection string would be?
buntine
07-17-2005, 04:01 AM
www.connectionstrings.com
IPConfig will give you your IP. When you configured SQL Server, you had the option of naming your server, othewise, I think it defaults to the machine name. 127.0.0.1 for localhost. If you have no uid or pwd, leave them blank.
Regards.
esthera
07-17-2005, 04:28 AM
I tried that and I got an error
Microsoft OLE DB Provider for SQL Server (0x80004005)
Login failed for user 'IUSR_EZ'. Reason: Not associated with a trusted SQL Server connection
any ideas?
buntine
07-17-2005, 05:28 AM
Alright, you need to enable Windows Authentication. For some reason, MS SQL has it disabled by default.
Are you running SQL Enterprise Manager?
From SQL EM, you need to select your server from the server tree, right-click it, go to "properties", open the "Security" tab, check the "SQL Server and Windows" checkbox under the "Authentication" heading, click OK.
You may need to restart SQL Server after this.
If that does not work, you may need to reference your SQL Server instance rather than just your server or your machine name. That will be in the form of MACHINE_NAME\SERVER_NAME
Example:
"Provider=SQLOLEDB;Data Source=BUNTINE\DOOM_SERVER;database=someDB;UID=poon;pwd=noof"
Regards.
esthera
07-17-2005, 05:33 AM
under authentication it says grant access already?
buntine
07-17-2005, 05:36 AM
What do you mean?
Did you see my edit?
esthera
07-17-2005, 08:07 AM
thanks -- i found it now... and changed those settings.
Now I get an error --
Error Type:
Provider (0x80004005)
Unspecified error
/dt/openconn.asp, line 19
Thanks for all your help --- I think once I get this right it will save a lot of time from uploading to the server while testing.
chrismartz
07-17-2005, 11:45 AM
what is on line 19?
esthera
07-17-2005, 11:52 AM
objconn.Open strCon
but then I thought I got it working with a dsn --- but then when I tried to run an insert record -- i got an error....
I'm basically giving up...
let me know if you have any other ideas.