-
I'm attempting to use RDO (Remote Data Object) 2.0 with VB6 to open a connection to a database (Informix in this case but it shouldn't matter). I can't seem to get it to work. Does anyone have a code sample that they would be willing to share showing me how to open a connection to a database.
-
Try it:
Code:
Private Sub Sample()
Dim rs As rdoResultset
Dim cn As New rdoConnection
Dim cl As rdoColumn
Dim er As rdoError
On Error GoTo EH
With cn
.Connect = "uid=;pwd=;server=SEQUEL;" _
& "driver={SQL Server};database=pubs;" _
& "DSN='';"
.CursorDriver = rdUseNone
.EstablishConnection rdDriverNoPrompt
Set rs = cn.OpenResultset( _
"select * from titles where Price < 50")
For Each cl In rs.rdoColumns
Debug.Print cl.OrdinalPosition, _
cl.Name, cl.Value
Next
End With
Exit Sub
EH:
For Each er In rdoErrors
Debug.Print er.Description
Next er
Resume Next
End Sub
------------------
smalig
[email protected]
smalig.tripod.com
-
And I have Oracle connection with RDO:
Code:
Sub LoginToDatabase()
Dim Msg$
On Error Resume Next
With rdoCn
.Connect = "DSN=oracle8;UID=guest;PWD=guest;"
.LoginTimeout = 25
.CursorDriver = rdUseOdbc
.EstablishConnection rdDriverNoPrompt, False
End With
Exit Sub
End Sub
------------------
smalig
[email protected]
smalig.tripod.com
-
Thanks smallig. I'm still getting an error (error 429 - Can't Create ActiveX Object). What version of VB are you using? I'm using the Professional Edition. I'm beginning to think that maybe I need the Enterprise edition.
Any thoughts on that.
-
Just a thought...once I was using the dao object but I forgot to reference the object in project references. Same type of error...
'''couldn't create object....
Wayne
-
It's referenced. It points to msrdo20.dll. But thanks for the thoughts.
-
Don't know if it will help you:
check http://support.microsoft.com/support.../Q177/3/94.ASP
Good Luck
Larisa
-
Maybe you need go to 'Project'-'References' and select 'Microsoft Remote Data Object 2.0'?
------------------
smalig
[email protected]
smalig.tripod.com
-
Microsoft data object is selected. Still get the error.
-
Thanks for the input Larisa. I attempted to follow the procedure for the client side of that document and I can't. It says to select an option that I don't have when I execute the dcomcnfg.exe program.
-
What version of Visual Basic are you using Smalig? I'm using the Professional Edition. This code was originally written (and working) with Visual Basic 4.0 Enterprise Edition.
-
I using VB6 now (3 years ago I started with VB3). Edition doesn't matter for this topic, I think. I have tested both my codes now, but they are working! I don't know your error - ask microsoft :)
------------------
smalig
[email protected]
smalig.tripod.com
-
I first posted a question about this error on 10/29 and got one response back then that said that RDO never worked in VB5 unless you had the Enterprise edition. I understand that you believe that it should work regardless of the edition (I think it should too). However, I have been staring at this problem for so long now that I am going nuts - I have looked all over the internet to see if Microsoft has any solution to the problem. I've tried everything that they suggested - nothing seems to work. I would be happy to ask Microsoft directly if I knew how. How does one ask them a question?
-
I looked for edition problems but finding only about RDO activex features. I have Enterprise Edition, but it must work in Standard too. You can try EE if it's possible for you.
Best regards.
------------------
smalig
[email protected]
smalig.tripod.com
-
Don't know if anybody cares but the problem seems to have been with VB 6 Professional edition. I finally found a Microsoft web site that spoke about my error (search on Q181852). It indicated that there was caused by mismatched .DLLs (between ODBC32.dll and msrdo20.dll). I tried 3 different ODBC32.dll files including one from the VB 6 install CD and they all had the same error. I found a copy of VB 6 on the Visual Studio CD and it worked fine with at least two of the ODBC versions (I never tried the third).