-
Nov 2nd, 1999, 02:23 AM
#1
Thread Starter
New Member
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.
-
Nov 2nd, 1999, 02:39 AM
#2
Addicted Member
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
smalig@hotmail.com
smalig.tripod.com
-
Nov 2nd, 1999, 02:41 AM
#3
Addicted Member
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
smalig@hotmail.com
smalig.tripod.com
-
Nov 2nd, 1999, 02:55 AM
#4
Thread Starter
New Member
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.
-
Nov 2nd, 1999, 03:07 AM
#5
_______
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
-
Nov 2nd, 1999, 03:09 AM
#6
Thread Starter
New Member
It's referenced. It points to msrdo20.dll. But thanks for the thoughts.
-
Nov 2nd, 1999, 03:15 AM
#7
Hyperactive Member
Don't know if it will help you:
check http://support.microsoft.com/support.../Q177/3/94.ASP
Good Luck
Larisa
-
Nov 2nd, 1999, 03:39 AM
#8
Addicted Member
Maybe you need go to 'Project'-'References' and select 'Microsoft Remote Data Object 2.0'?
------------------
smalig
smalig@hotmail.com
smalig.tripod.com
-
Nov 2nd, 1999, 03:41 AM
#9
Thread Starter
New Member
Microsoft data object is selected. Still get the error.
-
Nov 2nd, 1999, 03:46 AM
#10
Thread Starter
New Member
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.
-
Nov 2nd, 1999, 03:57 AM
#11
Thread Starter
New Member
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.
-
Nov 2nd, 1999, 04:02 AM
#12
Addicted Member
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
smalig@hotmail.com
smalig.tripod.com
-
Nov 2nd, 1999, 04:08 AM
#13
Thread Starter
New Member
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?
-
Nov 2nd, 1999, 04:17 AM
#14
Addicted Member
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
smalig@hotmail.com
smalig.tripod.com
-
Nov 4th, 1999, 02:09 AM
#15
Thread Starter
New Member
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).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|