PDA

View Full Version : Data access with Visual Interdev



rikell22
29th April 2003, 09:20
I'm trying to learn Visual Interdev. I have created a project and successfully connected to the webserver.

I now wish to access data from a SQL Server database on my machine.

I have created a Dataview using the Dataview wizard and taken the connection string from the Global.asa which is as follows.

Application("Connection1_ConnectionString") = "DSN=impreza;User Id=Marty;UID=Marty;APP=Microsoft Development Environment;WSID=IMPREZA;DATABASE=pubs;Trusted_Con nection=Yes"


I want to use the connection string to establish my own connection on a test page as follows

dim objConn

Set objConn = server.CreateObject("ADODB.connection")

objConn.Open "DSN=impreza;User Id=Marty;UID=Marty;APP=Microsoft Development Environment;WSID=IMPREZA;DATABASE=pubs;Trusted_Con nection=Yes"


but when I view it in a browser I keep getting the following error

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'IMPREZA\IUSR_IMPREZA'.
/Project4/ASP Page1.asp, line 9

When I create a DSN it connects fine, the dataview connects fine so why does it not connect from this test page. The test page is part of the project that the dataview is in

Could the problem be that I am running both SQL Server and IIS on the same machine. I am using XP Prof

ScotsPine
29th April 2003, 09:36
best is not to use dsn, they are not efficient. set up a login account on sql server and use that in your conn string. make sure to give the login permissions against (in this case) the 'pubs' database...sql server + iis on same box is fine, but not for prod systems...

darrenez
21st May 2003, 14:46
Go to microsoft.com and enter the error code.
You have to manually add some permissions.
I think it is in registry security.

Been there myself, just cannot remember any more than finding the nice how to fix it page on microsoft site ...

Karl1
21st May 2003, 19:35
Check whether the sql server is set-up for windows and SQL authentication. looks like it is trying to login using the defualt login created by the windows domain. Trying adding this account to the databse users.