
Using RDO to do SQL updates on SQL Server 6.0
Hello,
We are working on a project in which we need to establish a
connection with a remote SQL 6.0 DB using VB 4.0. We were told
that the new RDO and RDC functions that ship with the
Enterprise edition could do wonders for us, but we have yet to
reap the benefits of RDO.
In specific we are having MAJOR problems updating a resultset
accross multiple tables. We have tried several methods (both
RDO methods and the RDC) and everything we have tried has
failed. Most recently we have created a simple form with one
command button on it that has the following code.
Dim en As rdoEnvironment
Dim cn As rdoConnection
Dim rs As rdoResultset
Dim sConn As String
Dim sSQL As String
sConn = "DSN=*******;UID=*****;PWD=***;DATABASE=******;"
Set en = rdoEnvironments(0)
Set cn = en.OpenConnection("", rdDriverPrompt, False, sConn)
'Take the line extension _ out of the select statement
Set rs = cn.OpenResultset(Name:= _
"SELECT C.CompanionMediaPartIdentifier,
C.TitleIdentifier, C.MediaOrPartName,
T.TitleIdentifier, T.TitleName _
FROM CompanionMediaOrPart C, Title T _
WHERE C.TitleIdentifier = T.TitleIdentifier", _
Type:=rdOpenKeyset, LockType:=rdConcurRowver,
Option:=0)
rs.Edit
'Update the Component Name and Title name in the
CompanionMediaOrPart and Title tables respectively.
rs.rdoColumns(2).Value = "RDOTestJoin1"
rs.rdoColumns(4).Value = "RDOTestJoin2"
'Do the updates
rs.Update
'Craps out here
'
'
'
This code will produce the following error:
"S0022 [Microsoft][ODBC SQL Server Driver][SQL Server] Invalid
Columnn name 'Titlename'"
Also note that if we use DAO and JET(using a jet sql statement
with inner join rather that Transact SQL's where clause) the
updates WORK!!!
This is our sad story. Please advise us on how we can make
this work. Or if it is possible at ALL!!!
Please Help
Mike Porter