Connecting to remote SQL server via Internet using ASP page and Comm object 
Author Message
 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



Fri, 23 Aug 2002 03:00:00 GMT  
 Connecting to remote SQL server via Internet using ASP page and Comm object
See http://msdn.microsoft.com/library/psdk/dasdk/msre627m.htm for some
examples.

Kirk Allen Evans



Quote:
> 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")

- Show quoted text -

Quote:
> 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

Sent via Deja.com http://www.deja.com/
Before you buy.


Sun, 25 Aug 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Connecting to SQL Server via VBScript from Outlook using ADO

2. Using Vbscript and SQL-DMO to connect to SQL Server and run a T-SQL script

3. how to connect to remote sql server and which ports are used

4. Using ADO To Connect To ACCESS/SQL Server Across Internet

5. ADO connection to SQL server via Internet uses wrong port on some computers

6. Connecting to a remote oracle database via the Internet

7. Client app connect to remote database via Internet?

8. RDS? Connecting via Internet to remote database

9. Connecting to remote database via Internet

10. How can I capture url source code and post it to sql server via asp page

11. Using Outlook object in VB via SQL Server

12. Connecting to Remote SQL7 Server via ADO

 

 
Powered by phpBB® Forum Software