SQL Server Connection

Results 1 to 2 of 2

Thread: SQL Server Connection

  1. #1
    Join Date
    Dec 1969

    Default SQL Server Connection

    Hi,<BR>I am using the following vb.net code in a web form to connect to SQL server in a remote machine.<BR><BR>Dim SQLConn As New SqlConnection()<BR>Dim strSQL As String<BR>strSQL = "data source=remoteserver;initial catalog=pubs;user id=uid;password=pwd;"<BR>SQLConn.ConnectionString = strSQL<BR><BR> Try<BR> SQLConn.Open()<BR> Response.Write(SQLConn.State)<BR> Catch ex As Exception<BR> Response.Write(Err.Description)<BR> End Try<BR><BR>It was giving the error "SQL server doesn&#039;t exists or Access denied"<BR><BR>But the same code is working perfectly in a windows form.<BR><BR>I checked the User rights in the database and also the folder access rights in the SQL server machine.Everything seems to be ok.<BR><BR>What will be the probelm?<BR>Please help.<BR><BR>Jag<BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: SQL Server Connection

    I&#039;d say that the remote SQL Server is set up for Windows Authentication only. A windows form will run in the context of the currently logged-in user, so would have permission. ASP and ASP.NET run under the context of a guest account, so wouldn&#039;t.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts