|
 |
pro_vb thread: Client/Server over the internet Revisited
Message #1 by fxvega@v... on Mon, 17 Sep 2001 18:15:24
|
|
In late August I saw a P2P post in response to the post Subject: "Client
Server over the internet" that suggested using an ASP page as a source for
an ADO recordset object. I had never seen this approach before and my
search of my MSDN DVD did not turn up any documentation either on this
technique.
Based on this post I did give the suggested method a try using a current
application I am working on that uses MS-Access97 forms for the front-end
and a MS-SQL Server 7.0 database for the backend. My attempt was on my
intranet using IIS as the web server. However, I have not been
successful. The code I am using is below. As I step through the VBA code
I get an error message box when I get to the .Open line of the code
snippet located in my form. However, as best as I can tell the actual
error occurs in the ASP page on the very last line - response.write
stm.readtext(adReadAll)
Here is the code snippet in my form.
....
Dim rs As ADODB.Recordset
Dim strSQL As String
Set rs = New ADODB.Recordset
With rs
.Source = "http://localhost/begasp/test.asp"
.ActiveConnection = "Provider=MSPERSIST"
.CursorType = adOpenStatic
.LockType = adLockReadOnly
.Open
.ActiveConnection = Nothing
End With
........
Here is code in test.asp.
<%@ Language="VBScript"%>
<%
dim cn
dim rs
dim stm
dim strSQL
set cn = Server.CreateObject("ADODB.connection")
set rs = Server.CreateObject("ADODB.Recordset")
set stm = Server.CreateObject("ADODB.Stream")
cn.Provider = "SQLOLEDB"
cn.ConnectionString="Server=MyServer;Database=TestDB;user id=sa;password="
cn.Open
strSQL = "SELECT ListOrder, QCType FROM QCTypesLU ORDER BY ListOrder"
set rs = cn.execute(strSQL)
rs.save stm, adPersistXML
response.write stm.readtext(adReadAll)
%>
Could anyone point me to documents that discuss this technique in more
detail? I would certainly like to explore this method a little more and
see if it really could allow me to effectively use a VB or MS-Access front-
end to a backend DB via an internet connection.
Thanks,
Frank
|
|
 |