Razzak/anyone,

May I ask for some help or clarification on DNS-less connections, please?

I have occasional attempts at setting this up but mainly because I feel that I ought to know how to do it than any specific need. Each time I fail and then something else more important at that time takes my attention.

I have had another go since you gave such clear instructions to add to the "From The Edge" pdf document.

In v7.6 I get the following error message with this command:

SCONNECT ';Driver=R:BASE 7.6 Database Driver (*.rb1);dbq=d:\dbfiles\general\general'

Error message from server:
Specified driver could not be loaded due to system error 126 (R:BASE 7.6 Database Driver (*.rb1)).

In my ODBC Data Source Administrator applet (Vista Home Standard) the only entry for R:Base is on the Drivers' tab where it shows the version as 7.06.04.30919.

I assume that it is here that I have done or not done something as I should have.

I'm sure that there was a document that gave instructions on what to do to set this up but I can't find it again now. (Maybe it would be nice to incorporate the instructions for ODBC set-up into the From The Edge article?)

Thanks in advance for any help,
Regards,
Alastair.


----- Original Message ----- From: "A. Razzak Memon" <[EMAIL PROTECTED]>
To: "RBASE-L Mailing List" <[email protected]>
Sent: Tuesday, October 28, 2008 7:45 PM
Subject: [RBASE-L] - Re: Import & Export note field


At 11:15 AM 10/28/2008, Marc wrote:

Hi Razzak

Thanks, I tried the Insert method but get an error about
you can't have the destination table in the where clause
or something like that.  Also, I am hitting a snag on
Loading a table from a file.

No big deal, when I get more time to sit down and work
through this I should be able to get it to work.

My time is limited because I have to finish dealing with
putting out a fire, literally!


Marc,

Remember, whatever the hurdles may be, stick to the basic
principles of success, NEVER give up!

Based upon my last reply, I have prepared a sample application
with two databases (MasterDB and ArchDB) along with a command
file to help you understand the swift technique to migrate
data between two databases using the DSN-Less connection.

Sample Application: Migrating Data using DSN-Less Connection
Supported Versions: R:BASE 7.6 and Turbo V-8 for Windows
Date Posted: October 28, 2008

URL: http://www.razzak.com/sampleapplications

-----------------------------------------------------------------------
-- Using R:BASE 7.6 for Windows
-----------------------------------------------------------------------
-- Migrating_Data_Using_DSNLessConnection76.RMD
-- Migrating data between two databases using DSN-Less Connection
-- Using R:BASE 7.6 Database ODBC Driver
-- Author: A. Razzak Memon
-- Date Created: October 28, 2008
-- Related Database: MasterDB, ArchDB
-- Common table to migrate data in both databaes: Contact

-- Assure the connection of correct database
   IF (CVAL('DATABASE')) <> 'ArchDB' OR (CVAL('DATABASE')) IS NULL THEN
      CONNECT ArchDB IDENTIFIED BY NONE
   ENDIF
-- Make sure that previously SATTACHed table is detached
   SDETACH tContact NOCHECK
-- Make sure that the previously DSN-Less Database is Disconnected
   SDISCONNECT ';Driver=R:BASE 7.6 Database Driver (*.rb1);dbq=MasterDB'
-- Now Connect the Database Using the DSN-Less Connection
   SCONNECT ';Driver=R:BASE 7.6 Database Driver (*.rb1);dbq=MasterDB'
-- SAttach Table(s)
   SATTACH Contact AS tContact USING ALL
-- Review all records in SAttached tContact table (MasterDB Database)
   BROWSE * FROM tContact
-- Review all records in actual Contact table (ArchDB Database)
   BROWSE * FROM Contact
-- Project a temporary table with non matching <> records in ArchDB
   SET ERROR MESSAGE 2038 OFF
   DROP TABLE tmpContact
   SET ERROR MESSAGE 2038 ON
   PROJECT TEMPORARY tmpContact FROM tContact USING ALL +
   WHERE ContID NOT IN (SELECT ContID FROM Contact)
   INSERT INTO Contact +
   (CustID,ContID,ContFName,ContLName,ContPhone, +
   ContFax,ContCell,ContPager,ContEMail,ContInfo, +
   LastContactDate) +
   SELECT +
   CustID,ContID,ContFName,ContLName,ContPhone, +
   ContFax,ContCell,ContPager,ContEMail,ContInfo, +
   LastContactDate +
   FROM tempContact
-- Now review all records in actual Contact table (ArchDB Database)
   BROWSE * FROM Contact
-- Drop Temporary Table
   DROP TABLE tmpContact
-- Make sure that SATTACHed table is detached
   SDETACH tContact NOCHECK
-- Make sure that DSN-Less Database is Disconnected
   SDISCONNECT ';Driver=R:BASE 7.6 Database Driver (*.rb1);dbq=MasterDB'
   RETURN

-----------------------------------------------------------------------
-- Using R:BASE Turbo V-8 for Windows
-----------------------------------------------------------------------
-- Migrating_Data_Using_DSNLessConnection80.RMD
-- Migrating data between two databases using DSN-Less Connection
-- Using R:BASE Turbo V-8 Database ODBC Driver
-- Author: A. Razzak Memon
-- Date Created: October 28, 2008
-- Related Database: MasterDB, ArchDB
-- Common table to migrate data in both databaes: Contact

-- Assure the connection of correct database
   IF (CVAL('DATABASE')) <> 'ArchDB' OR (CVAL('DATABASE')) IS NULL THEN
      CONNECT ArchDB IDENTIFIED BY NONE
   ENDIF
-- Make sure that previously SATTACHed table is detached
   SDETACH tContact NOCHECK
-- Make sure that the previously DSN-Less Database is Disconnected
   SDISCONNECT ';Driver=R:BASE 8.0 Database Driver (*.rx1);dbq=MasterDB'
-- Now Connect the Database Using the DSN-Less Connection
   SCONNECT ';Driver=R:BASE 8.0 Database Driver (*.rx1);dbq=MasterDB'
-- SAttach Table(s)
   SATTACH Contact AS tContact USING ALL
-- Review all records in SAttached tContact table (MasterDB Database)
   BROWSE * FROM tContact
-- Review all records in actual Contact table (ArchDB Database)
   BROWSE * FROM Contact
-- Project a temporary table with non matching <> records in ArchDB
   SET ERROR MESSAGE 2038 OFF
   DROP TABLE tmpContact
   SET ERROR MESSAGE 2038 ON
   PROJECT TEMPORARY tmpContact FROM tContact USING ALL +
   WHERE ContID NOT IN (SELECT ContID FROM Contact)
   INSERT INTO Contact +
   (CustID,ContID,ContFName,ContLName,ContPhone, +
   ContFax,ContCell,ContPager,ContEMail,ContInfo, +
   LastContactDate) +
   SELECT +
   CustID,ContID,ContFName,ContLName,ContPhone, +
   ContFax,ContCell,ContPager,ContEMail,ContInfo, +
   LastContactDate +
   FROM tempContact
-- Now review all records in actual Contact table (ArchDB Database)
   BROWSE * FROM Contact
-- Drop Temporary Table
   DROP TABLE tmpContact
-- Make sure that SATTACHed table is detached
   SDETACH tContact NOCHECK
-- Make sure that DSN-Less Database is Disconnected
   SDISCONNECT ';Driver=R:BASE 8.0 Database Driver (*.rb1);dbq=MasterDB'
   RETURN

Have fun!

Very Best R:egards,

Razzak.




--------------------------------------------------------------------------------



No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.175 / Virus Database: 270.8.4/1752 - Release Date: 28/10/2008 10:04


Reply via email to