Solved

RDO connect to server

Posted on 1998-11-10
8
532 Views
Last Modified: 2013-12-25
The following problem persists... since I'm rather new to ODBC and RDO, I hope you will be able to help me. I'm trying to connect to a db on a ODBC server. The following code will do so, if the db is on the development computer.

    Set cnDays = New rdoConnection
    With cnDays
    .Connect = "uid=;pwd=;dsn=sbqvtest;"
    .CursorDriver = rdUseOdbc
    .EstablishConnection rdDriverNoPrompt, True
    Do While .StillConnecting
        DoEvents
    Loop
    End With

So the DSN is defined on my computer (Scratchy). However, if I want to connect to a db on a different computer (i.e. Quimby), how do I do so. Trying the following always gives me a "DSN not found, etc" error

    Set cnDays = New rdoConnection
    With cnDays
    .Connect = "Server=quimby;uid=;pwd=;dsn=sbqv_test_2;"
    .CursorDriver = rdUseOdbc
    .EstablishConnection rdDriverNoPrompt, True
    Do While .StillConnecting
        DoEvents
    Loop
    End With

If I set the prompt variable to 0, it prompts me for a data source, but on MY computer, not on the specified server...
The DB is an access driver, specified as a system DSN. All computers are on the same network, but the goal is to access it over the Inet...
Thanks in advance
0
Comment
Question by:lbk
8 Comments
 
LVL 1

Author Comment

by:lbk
ID: 1497559
Edited text of question
0
 
LVL 2

Expert Comment

by:vspeter
ID: 1497560
You would set a system DSN similar to how you did with the database on the development machine

however for this instance, click on the 'System Database ...' button on the ODBC Microsoft Access 97 Setup screen. It allows you to select the system database file which can be locate on remote computer before select the database.

Give that a try and see it goes. Cheers,


0
 
LVL 1

Author Comment

by:lbk
ID: 1497561
Sorry, I can't change the setup on the server side. The database has to be on Quimby, ODCB on quimby set up to have an entry for the DB. All I have power over is the client code, as demonstrated in the example above. It seems to me that the RDO endgine doesn't want to recognice the server name/location and therefor finds the local ODBC engine, rather than the one on Quimby
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 2

Expert Comment

by:Poddy
ID: 1497562
DOn't use DSNs,.

Use DSN-less connections, and define your parameters in the client side code (Or it's initialization settings - registry, ini-file, etc)



0
 
LVL 1

Author Comment

by:lbk
ID: 1497563
OK, can you give me code?
Something like this:

  Set cnConnection = New rdConnection
  cnConnection.Connect = XXXXX
  cnConnection.EstablishConnection XXX,XXX,...

  Etc, etc

thx in advance
0
 
LVL 1

Author Comment

by:lbk
ID: 1497564
none of this is working correctly. Turns out I need to use RDS with an appropriate business object. However, that donb't work for some reason either. Seems that the dependency information for one of the dlls is missing.
0
 
LVL 3

Accepted Solution

by:
hakyemez earned 100 total points
ID: 1497565
You Must DSN-less ODBC connection using the OpenConnection method against the default rdoEnvironment.
----------------------------------------------------------
Dim en as rdoEnvironment
Dim cn as rdoConnection

Set en = rdoEnvironments(0)
Set cn = en.OpenConnection(dsName:="", _
    Prompt:=rdDriverNoPrompt, _
    Connect:="uid=SA;pwd=;driver={SQL Server};" _
        & "server=SEQUEL;database=PUBS;")

Note:
---------------------------------------------
UID (UserName)= SA
PWD (Password)= <Blank>
Server        = SEQUEL (your sql server name)
Database      = PUBS   (your database name)
0
 
LVL 1

Author Comment

by:lbk
ID: 1497566
Thnx
LK
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now