testads.prg

testads.prg

Postby pieter » Wed Jun 17, 2015 7:24 am

Hello,

With the following code I get an error.

Code: Select all  Expand view

#include "fivewin.ch"
#include "ads.ch"
#include "xbrowse.ch"

Request DBFCDX

function main()

   RddRegister( "ADS", 1 )
   AdsSetServerType( ADS_LOCAL_SERVER )
   RDDSetDefault( "ADT" )

   XBROWSER "FLDS.ADT" FASTEDIT
   
   DbUseArea( .T., "ADS" , "Customer", "cust" )
   
   Browse()
   
   DbCloseArea()

return nil
 


Code: Select all  Expand view

Application
===========
   Path and name: C:\Pieter\sqlapp\testads.exe (32 bits)
   Size: 2,772,480 bytes
   Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20150213)
   FiveWin  Version: FWHX 15.01
   Windows version: 6.2, Build 9200

   Time from start: 0 hours 0 mins 3 secs
   Error occurred at: 06/17/15, 09:14:37
   Error description: Error ADSCDX/6082  Open error: Customer

Stack Calls
===========
   Called from:  => DBUSEAREA( 0 )
   Called from: testads.prg => MAIN( 15 )

System
======
   CPU type: Intel(R) Pentium(R) CPU  N3540  @ 2.16GHz 2166 Mhz
   Hardware memory: 3500 megs

   Free System resources: 90 %
        GDI    resources: 90 %
        User   resources: 90 %

   Windows total applications running: 4
      1 ,                                                                                                    
      2 , C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.9600.17810_none_a9edf0
      3 DDE Server Window, C:\Windows\SYSTEM32\OLE32.DLL                                                                      
      4 Tussen taken schakelen, C:\Pieter\sqlapp\testads.exe                                                                        

Variables in use
================
   Procedure     Type   Value
   ==========================
   DBUSEAREA
     Param   1:    L    .T.
     Param   2:    C    "ADS"
     Param   3:    C    "Customer"
     Param   4:    C    "cust"
     Local   1:    U    
     Local   2:    U    
   MAIN

Linked RDDs
===========
   ADS
   ADT
   ADSCDX
   ADSNTX
   DBF
   DBFFPT
   DBFBLOB
   DBFCDX
   DBFNTX

DataBases in use
================

Classes in use:
===============
     1 ERROR
     2 HASHENTRY
     3 HBCLASS
     4 HBOBJECT
     5 TFONT
     6 TWINDOW
     7 TDIALOG
     8 TBRUSH
     9 TCONTROL
    10 TXBROWSE
    11 TXBRWCOLUMN
    12 TBTNBMP
    13 TSCROLLBAR
    14 TRECT
    15 TREG32

Memory Analysis
===============
      229 Static variables

   Dynamic memory consume:
      Actual  Value:          0 bytes
      Highest Value:          0 bytes



I have installed Advantage database server.

Does somebody know what the problem is?

Pieter
User avatar
pieter
 
Posts: 117
Joined: Thu Jan 08, 2015 9:27 am

Re: testads.prg

Postby dutch » Wed Jun 17, 2015 9:50 am

It should be RDDSetDefault( "ADS" )
"ADT" is AdsSetFileType( ADS_ADT )
Code: Select all  Expand view
RDDSetDefault( "ADT" )


Why don't you continue try ADO or ADORDD? I'm trying to move to SQL as your post.
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1535
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: testads.prg

Postby pieter » Wed Jun 17, 2015 10:06 am

Hi Dutch, thank you.

I compiled and run testads.prg in C:\Pieter\fwh\samples and it worked. Somehow in Pieter\sqlapp it does not work.
The application which we want to migrate to sql, still uses ads, therefor I want to understand ADS as well.

Pieter
User avatar
pieter
 
Posts: 117
Joined: Thu Jan 08, 2015 9:27 am

Re: testads.prg

Postby dutch » Wed Jun 17, 2015 10:44 am

Dear Peter,

You need some file for local server connection. These files must be in c:\windows\system32 or Application Folder.
adsloc32.dll
adslocal.cfg
ansi.chr
axcws32.dll
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1535
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: testads.prg

Postby pieter » Wed Jun 17, 2015 11:14 am

Hey, it works now also in the other directory. (I copied the files adsloc32.dll and and ace32.dll from fwh\samples to my application directory sqlapp. Thanks for you help:D
User avatar
pieter
 
Posts: 117
Joined: Thu Jan 08, 2015 9:27 am

Re: testads.prg

Postby dutch » Wed Jun 17, 2015 10:27 pm

Hi Pieter,
My pleasure, I recommend you to try ADORDD (Contribute by Antonio F.).
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1535
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: testads.prg

Postby pieter » Thu Jun 18, 2015 9:31 pm

Hi Dutch

Yes!, I am very interested in this ADORDD from Antonio F. It could be a solution for my companies xharbour application to migrate to sql. So first I will try an example, to get an understanding of this ADORDD :D

Pieter
User avatar
pieter
 
Posts: 117
Joined: Thu Jan 08, 2015 9:27 am

Re: testads.prg

Postby reinaldocrespo » Thu Jun 18, 2015 10:07 pm

Hello everyone!

Maybe someone here can help me understand a bit more about ADORDD. As I read some of the documentation it seems to me like the tables must reside on a shared directory. For example; f:\Data\Customers.dbf (or whatever other name) and have a mapping to drive f: with read/write permissions.

If this is so, then what helps you avoid a user who is working late and after exiting your app double clicks on my computer and sees a drive F: and by curiosity double clicks on the folder Data. There he/she sees "customers.dbf" and decides to drag the file to the trashcan --only to see what happens? Or maybe drag it to a USB key and takes it outside the facility? If you have any large number of users, what guarantees this is not happening?

This would not be possible with a real client-server -- I mean a two tier system as any typical sql engine such as ADS.

So my question really is: --Is it possible to use ADORDD with msSQL or MySQL and **not** have the database stored on a share? I mean, store it somewhere where no-one has read/write access and is not a public site.

Thank you,


Reinaldo.
User avatar
reinaldocrespo
 
Posts: 972
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: testads.prg

Postby Antonio Linares » Fri Jun 19, 2015 8:58 am

Reinaldo,

Surely Antonio Ferreira can provide us a good advise regarding this
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41421
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: testads.prg

Postby AHF » Fri Jun 19, 2015 9:22 am

Reinaldo,

You must read the readme.pdf file at github.

1) All the working tables (database) reside always in the sql server of your choice

2) If you choose to have true locks and exclusive/shared use then you must have a share where ADORDD keeps:

a) tLocks.dbf - Lock control. You must indicate in the corresponding SET the rdd to use.
It must be a rdd that supports true locks as DBFCDX, ADS or any other.
This file only has field CODLOCK with a string tablename+recordnr and its use to control the lock.
When you request a lock ADORDD seeks the tablename+record you are using in SQL and if it finds it tries to lock it if not append a new one locking it.
Since the locking its done by the rdd if station goes down the lock will be released.
You can even delete the file exiting your app to avoid that gets too big with records that you will not use again soon.

b) tablename.ctrl . to check use exclusive / shared control for each table Its only a empty file that wll be opened in exclusive or shared mode and works like a semaphore.

These files are automatically created by ADORDD when needed.
If a user deletes then ADORDD will create them again every time you request a lock.
Of course in the meantime any locks requests will return .F.
Also the user will not be able to delete the file as long as the application is running.
After it doesnt matter.

So you dont have to worry about this.

On the other hand if you choose not to have true locks and trust that ADO and the server to do the job you wont need any of this. Simply SET ADO FORCE LOCKS OFF.

Resuming: You database can be wherever you want and only if you need true locks (like we) you must have that share.
If you are working on WAN you will need probably a VPN to access that share.
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 42 guests