Make your own free website on Tripod.com

REMOTE DATA SERVICES


THANKS TO ROY STRICKLAND FOR HIS RDS TRAINING AND CODE SAMPLES

AS WELL AS DAMIEN TUBBRITT FOR TRYING THIS WITH ORACLE!!


Remote Data Services will enable you to connect to an Oracle Server without having the Oracle Client installed. The manner in which this can be accomplished is by setting up a DSN (Data Source Name) on the machine which has the Oracle Client, as well as either IIS (Internet Information Server) or PWS (Pier Web Services) installed and simply setting that machine as your RDS Server.


Option Explicit

Dim ads As Object

Dim adf As Object

Dim objADORs As New ADODB.Recordset


Private Sub Form_Load()

txtServer.Text = "Http://sib664nt"

txtConnect.Text = "dsn=Damien;uid=scott;pwd=tiger;connectstring=orcl;"

txtSQL.Text = "select empno, ename, job, hiredate, sal from scott.emp"

Set ads = CreateObject("RDS.DataSpace")

Set adf = ads.CreateObject("RDSServer.DataFactory", txtServer.Text)

End Sub


Private Sub cmdGetRecordset_Click()

Set objADORs = adf.Query(txtConnect.Text, txtSQL.Text)

BindFields

cmdFirst.Enabled = True

cmdPrevious.Enabled = True

cmdNext.Enabled = True

cmdLast.Enabled = True

cmdAddNew.Enabled = True

End Sub


Private Sub cmdAddNew_Click()

objADORs.AddNew

Text1.SetFocus

End Sub


Private Sub cmdSubmitChanges_Click()

adf.SubmitChanges txtConnect.Text, objADORs

End Sub


Private Sub cmdRequery_Click()

Set objADORs = adf.Query(CStr(txtConnect.Text), CStr(txtSQL.Text))

BindFields

End Sub


Private Sub BindFields()

Set Text1.DataSource = objADORs

Set Text2.DataSource = objADORs

Set Text3.DataSource = objADORs

Set Text4.DataSource = objADORs

Set Text5.DataSource = objADORs

Text1.DataField = objADORs.Fields(0).Name

Text2.DataField = objADORs.Fields(1).Name

Text3.DataField = objADORs.Fields(2).Name

Text4.DataField = objADORs.Fields(3).Name

Text5.DataField = objADORs.Fields(4).Name

End Sub


RETURN TO HOME PAGE