
Connecting to remote SQL server via Internet using ASP page and Comm object
I have an asp page that uses a Comm object to connect to a remote SQL server
database via the internet.
When I test the DLL from within a VB 6 project everything works fine.
When I test from within the asp page I get an error message on the
CreateObject call that uses the DLL.
Microsoft OLE DB Provider for SQL Server error '80004005'
[DBMSSOCN]General network error. Check your network documentation.
This is the code in the VB 6 Dll
In the declaration section
Dim WmConn as ADODB.Connection
Private Sub Class_Initialize()
Set WMConn = New ADODB.Connection
With WMConn
.Provider = "SQLOLEDB"
.ConnectionString = "User ID=MyUser;Data
Source=xxx.xxx.xxx.xxx;Initial Catalog=MyDb"
.Open
End With
End Sub
xxx.xxx.xxx.xxx is the Ip address of the remote computer.
This works fine when it gets called from within a VB6 app as follows
Dim MyDll As MyDll.clsMyDll
In a command button
Private Sub cmdTestVehList_Click()
Dim VResponse As New Collection
Set MyDll = New MyDll.clsMyDll
Set VResponse = MyDll.GetSelectedRecords("TestValue", "TestVAlue2")
This returns the selected records in a collection that I can then parse and
use.
If, instead of using VB6, I use the following code in an asp page on the
same computer from within Visual Interdev (viewing the page in a browser -
ie5) to call the dll
Set MyDll = Server.CreateObject("MyDll.clsMyDll")
This line gives me the error 80004005 described above.
What do I need to do to be able to use my Dll to access the remote SQL
server via an ADO connection?
My objective is to distribute this DLL and the asp page to a number of
servers so that their clients when they hit this asp page on their server
can access the centralized data directly.
--
Robert Dufour, MCP, MCT
President SGI IMS Inc.
www.sgiims.com