Solved

RDO connect to server

Posted on 1998-11-10
8
535 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Updates not working for MS Windows 7 12 181
Saving history changes to sub form 4 48
message box in access 4 51
VB6 ListBox Question 4 48
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

860 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