• Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Data access with Visual Interdev

  • Thread starter Thread starter rikell22
  • Start date Start date
R

rikell22

Guest
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_Connection=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_Connection=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
 
Data access with Visual Interdev

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...
 
Permissions

Permissions

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 ...
 
Re: Permissions

Re: Permissions

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.
 

Advertisers

Back
Top