Connection with ADS by means of ADS DBE

This forum is for eXpress++ general support.
Message
Author
User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Connection with ADS by means of ADS DBE

#1 Post by Eugene Lutsenko »

I can not receive connection with ADS by means of ADS DBE. I do not know, whether ADS established at us works and everything is truly adjusted. There can be someone can prompt IP and port of any ADS which precisely works and is available through Internet that I could master the utility of ARC and take the first steps in development of the programs working with ADS through Internet at tabular level (ISAM). There can be someone will bring the initial text of the program working with ADS through Internet and realizing the elementary functions, for example database creation, record addition into it in the ISAM technologies. Approximately such, but working:

Code: Select all

// Обучение

#include "ads.ch"
#include "adsdbe.ch"
#include "dcdialog.ch"
#include "dccursor.ch"
#include "Gra.ch     "
#include "xbp.ch     "
#pragma library( "XBTBASE1.LIB" )
#pragma library( "XBTBASE2.LIB" )
#pragma library( "dclipx.lib  " )

   // Загрузить ADSDBE как стандартный механизм базы данных
   PROCEDURE DbeSys
      IF !DbeLoad( "ADSDBE" )
         Alert( "ADSDBE could not be loaded!" ) // ADSDBE не был загружен
      ENDIF
      DbeSetDefault( "ADSDBE" )
  RETURN

  PROCEDURE Main

     // ############################################################

// Соединиться с сервером базы данных
LOCAL cConnect := "DBE=ADSDBE;SERVER=\\IP:Port\DATA\"
LOCAL oSession := DacSession():new( cConnect )
IF !oSession:isConnected()
   MsgBOX( "Соединение с ADS (сервером) не может быть установлено !!!" )
   QUIT
ELSE
   MsgBOX( "Соединение с ADS (сервером) установлено успешно !!!" )
ENDIF

   DIRCHANGE("\\IP:Port\DATA\")   // Перейти в папку с базами данных на сервере

      * Открыть транзакцию  ###############################################
oSession:beginTransaction()

   ****** Если БД Classes.dbf нет, то создать ее
   cFileName  := "Classes"
   aStructure := { { "KOD     "  , "N", 15, 0 }, ;
                   { "NAME    "  , "C", 65, 0 }, ;
                   { "KOD_OLD "  , "N", 15, 0 }, ;
                   { "MARK    "  , "C", 1 , 0 }, ;
                   { "KOD_PRP "  , "N", 15, 0 }, ;
                   { "INT_INF "  , "N", 9 , 5 }, ;
                   { "SUM_II  "  , "N", 17, 5 }, ;
                   { "SII_PROC"  , "N", 7 , 3 }, ;
                   { "SII_GIST"  , "C", 40, 0 }, ;
                   { "RANG    "  , "N", 15, 0 }, ;
                   { "ABS     "  , "N", 15, 0 }, ;
                   { "PERC_FIZ"  , "N", 7 , 3 }, ;
                   { "UR_MERL "  , "N", 4 , 0 }  }
   DbCreate( cFileName, aStructure )
   CLOSE ALL
   USE Classes SHARED NEW
   APPEND BLANK
   REPLACE Kod WITH 1
   REPLACE Name WITH "Привет"







      * Закрыть транзакцию  ###############################################
oSession:commitTransaction()

     // ############################################################
     // Закрыть базы данных и отсоединиться от сервера.
      DbCloseAll()
      oSession:disconnect()

   RETURN

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Connection with ADS by means of ADS DBE

#2 Post by rdonnay »

Are you getting an error code from ADS?
The eXpress train is coming - and it has more cars.

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: Connection with ADS by means of ADS DBE

#3 Post by Eugene Lutsenko »

Isn't present I receive. The server long enough (some minutes) hangs, and then expression !oSession:isConnected () gives out Truth value. Can be to me to report to you IP and port and you define live ADS or not so?

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Connection with ADS by means of ADS DBE

#4 Post by rdonnay »

If oSession:isConnected() returns a .T. then you should be able to open a database.

Have you tried to do this?
The eXpress train is coming - and it has more cars.

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: Connection with ADS by means of ADS DBE

#5 Post by Eugene Lutsenko »

Not oSession:isConnected () returns .T., and !oSession:isConnected (), that is () returns to oSession:isConnected.F. I used the standard program from examples across Alaska which practically without changes gave in the previous post, and would see, if connection turned out. I then certainly tried both to open base, and to work with it, but in an example I tried to create it on the server. At me for a long time hands are scratched it everything to test.

On it there are many reasons, but the main following:
1. Removal of rigid restrictions on dimension and the sizes of processed databases.
2. Ensuring remote simultaneous work through Internet with databases on the server.
3. Possibility of use of ADS of possibilities of multinuclear processors (about it I asked in a post about Alaska).

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Connection with ADS by means of ADS DBE

#6 Post by rdonnay »

What is the return value of oSession:getLastError() ?
The eXpress train is coming - and it has more cars.

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: Connection with ADS by means of ADS DBE

#7 Post by Eugene Lutsenko »

I had such impression that oSession:getLastError () in general returns nothing as MsgBOX( nErrorCode) doesn't give out an error of execution and at all doesn't display a window, and MsgBOX( cErrorMsg) deduces a gap. The fragment of the testing program is lower:

Code: Select all

LOCAL cConnect := "DBE=ADSDBE;SERVER=\\IP:Port\AID_DATA\"
LOCAL oSession := DacSession():new( cConnect )

LOCAL nErrorCode := oSession:getLastError() 
LOCAL cErrorMsg  := oSession:getLastMessage()

MsgBOX( nErrorCode )
MsgBOX( cErrorMsg )

IF !oSession:isConnected()
I can be incorrect I write the appeal to the server: SERVER = \\IP:Port\?

Whether there is any simple program for check of operability of ADS into which it would be possible to enter IP and ADS port and it would give out, whether ADS or not and if isn't present is functional, would give out diagnostic error messages? I tried to use for these purposes ARC. Here that it gives out at connection check:

Image

Connection attempts in ARC issue messages on excess of a waiting time and a mistake:
Image
Image

User avatar
Auge_Ohr
Posts: 1428
Joined: Wed Feb 24, 2010 3:44 pm

Re: Connection with ADS by means of ADS DBE

#8 Post by Auge_Ohr »

hi,

you should ask in ADS Forum if you have Problem to setup ADS / AIS.
greetings by OHR
Jimmy

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: Connection with ADS by means of ADS DBE

#9 Post by Eugene Lutsenko »

Yes it seems at installation of ADS and the ADS and firewall control of special problems wasn't. I consulted on to experts of a site: http://www.softscribe.ru/ And generally therefore I also asked, whether there is no public ADS to try the test programs and to understand in what the reason:
1. ADS isn't established.
2. Incorrect programs.
And so I even between these options can't choose, what correct.
Somebody can will try to get access to this my server and will tell, it works or not by means of programs which with guarantee work (are already checked).

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: Connection with ADS by means of ADS DBE

#10 Post by Eugene Lutsenko »

When I will begin completely ADS (http://www.softscribe.ru/) will use all random access memory and all kernels of the processor and its 64-word length are involved. For now one kernel, to 2Гб random access memory and 32 categories is used, and the rest isn't present. Rigid restrictions on the sizes of files and dimension of databases will be besides removed. Therefore ADS is necessary to me.

Post Reply