Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How do I connect from a Webfarm not on domain to a server on a domain?

How do I connect from a Webfarm not on domain to a server on a domain?

Scheduled Pinned Locked Moved ASP.NET
questiondatabasesysadmincsharp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MacSpudster
    wrote on last edited by
    #1

    Scenario: I've a WebFarm with 2 web servers which are NLBs (network load balanced). Web1 and Web2; they are not part of a domain. I have a third server, Server3, which is part of a domain and on the same physical network, and it has an MSAccess database which is used on the external webfarm as well as on the internal intranet. I can connect via the intranet because the DB file is on the same box from which the intranet is being served (Server3) While I've got code below which is VB.NET-related, to me I think this is an OS-related topic; but I could be wrong.. How can I 'connect' to the MSAccess database file on Server3 from either Web1 or Web2? When I use the code below, I get this error: The Microsoft Jet database engine cannot open the file '\\Server3\C$\MSAccessDBs\Database.mdb'. It is already opened exclusively by another user, or you need permission to view its data. Any clues? Here's more info: I'm using ASP.NET v1.1, using a standard OLEDb connection (referencing the database by path [see code below]). From the ASP.NET v1.1 "web.config" file (I'll refer to this as ConnectStringA) 1 [appSettings] 2 <[dd key="strConnectAccess" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\Server3\MSAccess\DatabaseFile.mdb"/] 3 [/appSettings] actual "connect" code: ... I'm pausing here. I went to go look at the connection code and there is a direct inline connection string to another database which ap[ears to not be failing: \\Server3\C$\MSAccess\LogError.mdb --> I'll refer to this as ConnectStringB, The difference between ConnectStringA and ConnectStringB is that ConnectStringA assumes a shared folder, whereas ConnectStringB goes direct, as it includes the "\C$" element. Well, I added the "\C$" to ConnectStringA, (now "\Server3\C$\MSAccess\DatabaseFile.mdb") and it still fails. Yes, I would agree there is some sort of permissions error. The database is set for Shared. Here is my "connect" code (modified to protect a client's database) 1 Sub btnlogin_click(ByVal sender As Object, ByVal e As EventArgs) 2 Dim conpw As OleDb.OleDbConnection 3 Dim cmdpw As OleDb.OleDbCommand 4 Dim strsql As String 5 6 Dim dappw As OleDb.OleDbDataAdapter 7 Dim dstpw As DataSet 8 Dim rowpw As DataRow 9 Dim bldpw As OleDb.OleDbCommandBuilder 10 Dim inti As Integer 11 Dim rdrpw As OleDb.OleDbDataReader 12 13 Dim xx As String 14 Dim yy As String 15 Dim strmsg As String 16 Dim strcounties As String 17 Dim lngposition As Long 18 Dim strIsCSR As String

    I 1 Reply Last reply
    0
    • M MacSpudster

      Scenario: I've a WebFarm with 2 web servers which are NLBs (network load balanced). Web1 and Web2; they are not part of a domain. I have a third server, Server3, which is part of a domain and on the same physical network, and it has an MSAccess database which is used on the external webfarm as well as on the internal intranet. I can connect via the intranet because the DB file is on the same box from which the intranet is being served (Server3) While I've got code below which is VB.NET-related, to me I think this is an OS-related topic; but I could be wrong.. How can I 'connect' to the MSAccess database file on Server3 from either Web1 or Web2? When I use the code below, I get this error: The Microsoft Jet database engine cannot open the file '\\Server3\C$\MSAccessDBs\Database.mdb'. It is already opened exclusively by another user, or you need permission to view its data. Any clues? Here's more info: I'm using ASP.NET v1.1, using a standard OLEDb connection (referencing the database by path [see code below]). From the ASP.NET v1.1 "web.config" file (I'll refer to this as ConnectStringA) 1 [appSettings] 2 <[dd key="strConnectAccess" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\Server3\MSAccess\DatabaseFile.mdb"/] 3 [/appSettings] actual "connect" code: ... I'm pausing here. I went to go look at the connection code and there is a direct inline connection string to another database which ap[ears to not be failing: \\Server3\C$\MSAccess\LogError.mdb --> I'll refer to this as ConnectStringB, The difference between ConnectStringA and ConnectStringB is that ConnectStringA assumes a shared folder, whereas ConnectStringB goes direct, as it includes the "\C$" element. Well, I added the "\C$" to ConnectStringA, (now "\Server3\C$\MSAccess\DatabaseFile.mdb") and it still fails. Yes, I would agree there is some sort of permissions error. The database is set for Shared. Here is my "connect" code (modified to protect a client's database) 1 Sub btnlogin_click(ByVal sender As Object, ByVal e As EventArgs) 2 Dim conpw As OleDb.OleDbConnection 3 Dim cmdpw As OleDb.OleDbCommand 4 Dim strsql As String 5 6 Dim dappw As OleDb.OleDbDataAdapter 7 Dim dstpw As DataSet 8 Dim rowpw As DataRow 9 Dim bldpw As OleDb.OleDbCommandBuilder 10 Dim inti As Integer 11 Dim rdrpw As OleDb.OleDbDataReader 12 13 Dim xx As String 14 Dim yy As String 15 Dim strmsg As String 16 Dim strcounties As String 17 Dim lngposition As Long 18 Dim strIsCSR As String

      I Offline
      I Offline
      icestatue
      wrote on last edited by
      #2

      Check if you have access rights on the table you are trying to view. If the account you log on with the connection string doesn't match the table access rights you may get that message. Thats one possible check. There is also a connection attribute that needs to be assigned for DataReaders to work correctly. Asynchronous Processing=true; I believe Good luck

      nothing

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups