topic
stringlengths 1
63
| text
stringlengths 1
577k
⌀ |
|---|---|
ADS Server & Linux
|
Mike,
I'm working with Linux server with ADS 7.1 many years, until now I don´t have any problems, I use ADT file and ADS Dictionary. In my work there are many systems ( FWH + xHb ) which access to differents ads databases plus PHP users to access the same data, the server is Pentium 4 2.4 Ghz 512 MB RAM, in the same servere there are another DB like Postgresql.
Regards
Marcelo
|
ADS Server + Clipper
|
Buen día.
Tengo una vieja aplicación en Clipper de 16 bits con DBF/CDX.
Quería saber si existe la posibilidad de adaptarla para usar ADS Server. Obviamente lo ideal sería ya migrarla a FiveWin, pero por cuestiones de tiempo quisiera ir primero por ese camino para luego ir migrando de a poco.
Si alguien tiene algún ejemplo mínimo de como se debería implementar o algo estaré agradecido.
Desde ya muchas gracias.
|
ADS Server + Clipper
|
Esteban,
Prueba a construirla con Harbour. Deberias ser capaz de construirla facilmente.
Una vez la tengas funcionando con Harbour, el resto es muy simple <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
ADS Server + Clipper
|
Si Antonio, conozco los pasos una vez que la tengo en 32 bits.
En este caso particular, he notado que está desarrollado de una manera bastante desprolija y pasarlo implican muchas cosas para corregir.
Variables no declaradas, variables con nombres largos que al ser de 16 bits funcionan porque se trucan etc...
Ej:
Local MiVariableLarga := 0
y al usarla ponen
MiVariableLar := 1
MiVariableL := 2
En 16 bits anda porque se trunca, pero al pasar a 32 vuela en 1000 pedazos todo.
Por eso consultaba si había algun ejemplo de ADS en 16 bits, porque antes debería corregir todas esas inonsistencias que no fueron pensadas por las personas que escribieron ese fuente. (Son fuentes muy viejos)
De todos modos, muchas gracias por tu respuesta.
Saludos,
|
ADS Server + Clipper
|
Entonces entiendo que lo único que necesitas son las librerias de ADS para Clipper <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
ADS Server + Clipper
|
Así es...
Si es que existen.
|
ADS Server + Clipper
|
Si que existe. La cuestión ahora es encontrarla <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
ADS Server + Clipper
|
Aqui la tienes, gracias a Cristobal <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
[url:1urif68n]http://devzone.advantagedatabase.com/dz/content.aspx?key=20&Release=19&Product=19&Platform=6[/url:1urif68n]
|
ADS Server + Clipper
|
Muchas gracias a ambos!
|
ADS Server + Clipper
|
Antonio,
¿Cómo estás?
Si quisiera pasar un PRG de clipper 5.3 a Harbour para 32bits.
Qué pasos debería hacer?
Podrías darme una mano para poder compilar?
Desde ya muchas gracias.
Saludos,
|
ADS Server + Clipper
|
Te refieres a construir toda la aplicación ó solo a compilar un PRG ?
Para el primer caso, solo tienes que crear un archivo HBP y usar hbmk2.exe
Para compilar un sólo PRG:
harbour /n fichero.prg
|
ADS Server + Clipper
|
Contruir una aplicación completa.
La tengo en clipper, tengo todos los PRGs.
Ej: Tengo
INICIO.PRG -> Aquí está la función Main()
FUNCIONES.PRG
VARIOS.PRG
OTRO.PRG
Con esos 4 PRGs quisiera armar Sistema.exe
Desde ya muchas gracias.
Saludos
|
ADS Server + Clipper
|
miapp.hbp
[code=fw:289cqe40]<div class="fw" id="{CB}" style="font-family: monospace;">INICIO.PRG<br />FUNCIONES.PRG<br />VARIOS.PRG<br />OTRO.PRG</div>[/code:289cqe40]
hbmk2.exe miapp.hbp
Asi de simple <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
ADS Server + Clipper
|
Antonio,
Muchas gracias por la respuesta.
Intenté compilar de la manera indicada lo siguiente un solo PGR con el siguiente código :
[code=fw:1b4jl3na]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// INICIO DEL PROGRAMA //</span><br /><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br />SetMode<span style="color: #000000;">(</span><span style="color: #000000;">25</span>,<span style="color: #000000;">80</span><span style="color: #000000;">)</span><br />CLS<br />@ <span style="color: #000000;">10</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">say</span> <span style="color: #ff0000;">'Hello World'</span><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:1b4jl3na]
Al compilar me da el siguient error:
[code=fw:1b4jl3na]<div class="fw" id="{CB}" style="font-family: monospace;"><br />Fatal: <span style="color: #000000;">Unable</span> <span style="color: #0000ff;">to</span> open file <span style="color: #ff0000;">'HBEXTERN.LIB'</span><br /> </div>[/code:1b4jl3na]
Que me estaría faltando?
Desde ya muchas gracias.
Saludos,
|
ADS Server + Clipper
|
Ya pude generar el .exe
Agregué la lib y quedó.
Muchas gracias.
|
ADS Summit Sep 19-20
|
Hi everyone.
I hope xbase developers in North America take advantage of a free ADS summit taking place in Boise this next September 19-20. All you have to provide is your airfare + hotel. All training sessions + food + drink are paid by Sybase. You will also walk away with a book and a 5 user version of the server. I'm sure those who attend will not regret the experience.
If we can get a few of us to attend, then I'm sure we can get a special track for xbase developers. So please send me an email or reply to this thread if you are interested. It would be great if a nice group of us could meet.
Reinaldo.
|
ADS Summit Sep 19-20
|
Is there a link for registration ?
|
ADS Summit Sep 19-20
|
what's your email;
|
ADS Summit Sep 19-20
|
There is no link just yet. Once the announcement becomes official, I will post the link. I'm making this "pre-official" announcement in an effort to start gathering xharbourers in NA.
You may write to me at reinaldo.crespo on gmail.
Thank you,
Reinaldo.
|
ADS Summit in Boise is now official
|
To all xbase in North America;
ADS summit is now official. Sep 18 and 19.
[url:acqxne6m]http://response.sybase.com/forms/2012ADSTechSummit[/url:acqxne6m]
[quote:acqxne6m]Our next Advantage Technical Summit has been scheduled for 18 – 19 September in lovely Boise Idaho. Boise is where most of the Advantage team is located including engineering, support, sales, and product management. As a result, attending the training gives you the unique opportunity to have access to the entire technical team, with plenty of time for one on one interaction.[/quote:acqxne6m]
I think this is a great opportunity to learn new things, meet people, and share information. I will take with me a lot of code where I show how to manage ads DD from xharbour and how to use SQL + ISAM and PHP on the same set of .dbfs or .adts.
Reinaldo.
|
ADS Summit in Boise is now official
|
Hi Reinaldo
Can you manage indexes with PHP with/without using ADS.
Regards
Colin
|
ADS Summit in Boise is now official
|
What do you mean manage indexes?
With PHP + ADS you can do any SQL on a dbf/fpt/cdx or dbf/dbt/ntx or dbf/fpt/vfp index, or adt/adm/adi:
UPDATE customers SET LasName = 'Doe', FirstName = 'John' WHERE customerid = '0001'
or
INSERT INTO customers (LastName, FirstName, Customerid ) VALUES( 'Doe', 'John', '0001' )
or
SELECT * FROM customers WHERE customerid = ?
As a parametized query or non-parametized (parametized query is much better to avoid sql injections).
All and any SQL will read/write to and from a dbf or adt table.
I have a couple of web portals written in PHP that read data from .dbf/ntx (old old old stuff) and .dbf/cdx.
I hope I answered the question.
Reinaldo.
|
ADS Summit in Boise is now official
|
Hi.
If I could get a headcount of people planning to attend the Summit, perhaps we can have a track specially designed for harbour. If the number of people confirming is large enough, then I can try to persuade Sybase to bring Antonio.
If you rather write via email, please write to reinaldo.crespo at gmail.
Thank you,
Reinaldo.
|
ADS Summit in Boise is now official
|
Hello Reinaldo,
I'm so eager with ADS + RadPHP..
Can you please please start on how to connect from RadPHP?
Sorry if it's a little off-topic.
Kind regards,
|
ADS Summit in Boise is now official
|
Frances;
Hi. I trust you are doing file. I have seen some of your screenshots and always learn something from you.
By RadPHP I think you mean Embarcadero's PHP? I have never used RadPHP, I don't know what the difference is to plain vanilla PHP (which is what I have). I write php using the same editor (uestudio) that I use for my win32 fwh apps.
PHP with ADS works perfectly. I suggest you start by opening the help file and search for PHP. Open the 2nd entry: "A Sample PHP Web Site". You will see screenshots + PHP code. Use the forward and back buttons to see each .php file. it shows how to connect, insert, update, select data and show it on a web page. Simple PHP, but the code will show you everything you need.
It is unlikely that PHP will come setup with the Advantage language extension, but the help file also shows you that. I'm using Linux (Fedora 14) with Apache server to host the page. The actual ADS server is Windows Server and physically over 3 thousand miles away. The web server serves php pages while the data is fetched from the ADS server. A have a second setup where the web server is right next to the ADS server, both running Linux. And a third setup I also have is one where the Web server and the ADS server are both running on the same linux server.
It doesn't have to be PHP, it could also be Java, Perl, asp.net. Advantage has a client for each just like for PHP.
Here is the code I use to connect:
[code=fw:1ap9itha]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------------------------------------------------</span><br /><span style="color: #00C800;">function</span> DDconnect<span style="color: #000000;">(</span> $db, &$rConn <span style="color: #000000;">)</span> <br /><span style="color: #000000;">{</span><br /> $user = $_SESSION<span style="color: #000000;">[</span> <span style="color: #ff0000;">'userid'</span> <span style="color: #000000;">]</span>;<br /> $pass = $_SESSION<span style="color: #000000;">[</span> <span style="color: #ff0000;">'password'</span> <span style="color: #000000;">]</span>;<br /><br /> $rConn = ads_connect<span style="color: #000000;">(</span> $db, $user, $pass <span style="color: #000000;">)</span>; <br /><br /> <span style="color: #00C800;">return</span> is_resource<span style="color: #000000;">(</span> $rConn <span style="color: #000000;">)</span>;<br /><span style="color: #000000;">}</span></div>[/code:1ap9itha]
The login.php code is here. It is mostly PHP, HTML and some CSS:
[code=fw:1ap9itha]<div class="fw" id="{CB}" style="font-family: monospace;"><?php<br /><br /> session_start<span style="color: #000000;">(</span><span style="color: #000000;">)</span>;<br /> include <span style="color: #ff0000;">"classes.php"</span> ;<br /> include <span style="color: #ff0000;">"include/corefuncs.php"</span>;<br /> <br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span> $_POST && isset<span style="color: #000000;">(</span> $login <span style="color: #000000;">)</span> && <span style="color: #000000;">(</span> <span style="color: #0000ff;">strlen</span><span style="color: #000000;">(</span> $_POST<span style="color: #000000;">[</span> <span style="color: #ff0000;">"custid"</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span> < <span style="color: #000000;">3</span> || <span style="color: #0000ff;">strlen</span><span style="color: #000000;">(</span> $_POST<span style="color: #000000;">[</span> <span style="color: #ff0000;">"password"</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span> < <span style="color: #000000;">6</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> die<span style="color: #000000;">(</span> <span style="color: #ff0000;">"bad user name or password"</span> <span style="color: #000000;">)</span>;<br /> <br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span> $_POST && array_key_exists<span style="color: #000000;">(</span><span style="color: #ff0000;">'custid'</span>, $_POST<span style="color: #000000;">)</span> && <br /> array_key_exists<span style="color: #000000;">(</span> <span style="color: #ff0000;">'password'</span>, $_POST <span style="color: #000000;">)</span> &&<br /> array_key_exists<span style="color: #000000;">(</span> <span style="color: #ff0000;">'submit'</span>, $_POST <span style="color: #000000;">)</span> && <br /> !empty<span style="color: #000000;">(</span> $_POST<span style="color: #000000;">[</span> <span style="color: #ff0000;">'custid'</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span> &&<br /> !empty<span style="color: #000000;">(</span> $_POST<span style="color: #000000;">[</span> <span style="color: #ff0000;">'password'</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> $login = <span style="color: #000000;">1</span>;<br /> <br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span> isset<span style="color: #000000;">(</span> $login <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">{</span><br /> <br /> nukeMagicQuotes<span style="color: #000000;">(</span><span style="color: #000000;">)</span>;<br /><br /> $user = $_POST<span style="color: #000000;">[</span> <span style="color: #ff0000;">"custid"</span> <span style="color: #000000;">]</span> ;<br /> $pass = $_POST<span style="color: #000000;">[</span> <span style="color: #ff0000;">"password"</span> <span style="color: #000000;">]</span> ;<br /> <br /> $_SESSION<span style="color: #000000;">[</span> <span style="color: #ff0000;">'userid'</span> <span style="color: #000000;">]</span> = $user;<br /> $_SESSION<span style="color: #000000;">[</span> <span style="color: #ff0000;">'password'</span> <span style="color: #000000;">]</span> = $pass;<br /> <br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span> !DDconnect<span style="color: #000000;">(</span> _DATA_DICT, $rConn <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <br /> die<span style="color: #000000;">(</span> <span style="color: #ff0000;">"<br> Error connecting to Database.<br>"</span> <span style="color: #000000;">)</span> ;<br /><br /> $curruser = <span style="color: #00C800;">new</span> user;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> !$curruser->load<span style="color: #000000;">(</span> $rConn, $user <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> die<span style="color: #000000;">(</span> <span style="color: #ff0000;">"<br> No access has been set for referring physician."</span> <span style="color: #000000;">)</span> ;<br /><br /> <span style="color: #B900B9;">//log successfull login attempt into database</span><br /> <span style="color: #B900B9;">//table log keeps track of each successfull login for analisys and statistics.</span><br /> $rStmt = ads_prepare<span style="color: #000000;">(</span> $rConn, <span style="color: #ff0000;">"INSERT INTO log ( [UserId], [login_date], [ip] ) VALUES( ?, now(), ? )"</span> <span style="color: #000000;">)</span>;<br /> $aParms = array<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> => $user, <span style="color: #000000;">2</span> => $_SERVER<span style="color: #000000;">[</span> <span style="color: #ff0000;">'REMOTE_HOST'</span> <span style="color: #000000;">]</span>.$_SERVER<span style="color: #000000;">[</span> <span style="color: #ff0000;">'REMOTE_ADDR'</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span>;<br /> $rResult = ads_execute<span style="color: #000000;">(</span> $rStmt, $aParms <span style="color: #000000;">)</span>;<br /> <br /> ads_close<span style="color: #000000;">(</span> $rConn <span style="color: #000000;">)</span>;<br /> <br /> $curruser->password = $pass;<br /> $_SESSION<span style="color: #000000;">[</span> <span style="color: #ff0000;">'user'</span> <span style="color: #000000;">]</span> = $curruser;<br /> $_SESSION<span style="color: #000000;">[</span> <span style="color: #ff0000;">'userid'</span> <span style="color: #000000;">]</span> = $curruser->userid;<br /> $_SESSION<span style="color: #000000;">[</span> <span style="color: #ff0000;">'password'</span> <span style="color: #000000;">]</span> = $pass;<br /> $_SESSION<span style="color: #000000;">[</span> <span style="color: #ff0000;">'username'</span> <span style="color: #000000;">]</span> = $curruser->GetName<span style="color: #000000;">(</span><span style="color: #000000;">)</span>;<br /> <br /> header<span style="color: #000000;">(</span> <span style="color: #ff0000;">'location: ./main.php'</span> <span style="color: #000000;">)</span>;<br /> exit;<br /> <span style="color: #000000;">}</span><br /><br />?><br /><br /><style type=<span style="color: #ff0000;">"text/css"</span>><br />input.required <span style="color: #000000;">{</span>background-<span style="color: #0000ff;">color</span>:<span style="color: #000000;">darkred</span>; <span style="color: #0000ff;">color</span>:<span style="color: #000000;">white</span> <span style="color: #000000;">}</span><br /><br /><br />body <span style="color: #000000;">{</span><br /> padding: <span style="color: #000000;">0</span>;<br /> margin: 90px <span style="color: #000000;">10</span>% <span style="color: #000000;">0</span> 230px;<br /> background: #fff url<span style="color: #000000;">(</span>background.png<span style="color: #000000;">)</span> top <span style="color: #0000ff;">left</span> no-repeat;<br /> <span style="color: #0000ff;">color</span>: #fff;<br /> text-align: <span style="color: #0000ff;">center</span>;<br /> line-height: <span style="color: #000000;">100</span>%;<br /> font-family: <span style="color: #ff0000;">"Trebuchet MS"</span>, Arial, Helvetica, sans-serif<br /><span style="color: #000000;">}</span><br /><br />label <span style="color: #000000;">{</span><br /> font-<span style="color: #0000ff;">size</span>: 10px;<br /> width: 3em;<br /> float: <span style="color: #0000ff;">left</span>;<br /> text-align: <span style="color: #0000ff;">right</span>;<br /> margin: <span style="color: #000000;">0</span>.05em 0em;<br /> clear: <span style="color: #000000;">both</span>; <span style="color: #000000;">}</span><br /><br />input <span style="color: #000000;">{</span><br /> float: <span style="color: #0000ff;">left</span>;<br /> margin: .1em .1em;<br /> height: 20px;<br /> width: 110px; <span style="color: #000000;">}</span><br /><br />#subbutton <span style="color: #000000;">{</span><br /> font-<span style="color: #0000ff;">size</span>: 11px;<br /> float: <span style="color: #000000;">none</span>;<br /> width: <span style="color: #000000;">auto</span>;<br /> margin-bottom: 1em;<br /> margin-<span style="color: #0000ff;">left</span>: 0em;<br /> height: 25px;<br /> line-height: <span style="color: #000000;">100</span>%;<br /> clear:<span style="color: #000000;">both</span>; <span style="color: #000000;">}</span><br /><br />#nav <span style="color: #000000;">{</span><br /> position: <span style="color: #000000;">absolute</span>;<br /> top: 280px;<br /> <span style="color: #0000ff;">left</span>: 2px;<br /> width: 123px;<br /><span style="color: #000000;">}</span><br /><br />#header <span style="color: #000000;">{</span><br /> position: <span style="color: #000000;">absolute</span>;<br /> top: 10px;<br /> <span style="color: #0000ff;">left</span>: 660px;<br /><span style="color: #000000;">}</span><br /><br />#footer <span style="color: #000000;">{</span><br /> position: <span style="color: #000000;">absolute</span>;<br /> bottom:10px;<br /> <span style="color: #0000ff;">color</span>: #aaa ;<br /> <span style="color: #0000ff;">left</span>: 1px;<br /> width: 150px;<br /> font-<span style="color: #0000ff;">size</span>: <span style="color: #000000;">75</span>%;<br /> clear: <span style="color: #000000;">both</span>; <br /><span style="color: #000000;">}</span><br /><br />#textarea <span style="color: #000000;">{</span><br /> font-<span style="color: #0000ff;">size</span>: <span style="color: #000000;">90</span>%;<br /> position:<span style="color: #000000;">absolute</span>;<br /> top: 40px;<br /> margin: 60px <span style="color: #000000;">5</span>% <span style="color: #000000;">0</span> 1px;<br /> min-width: 425px; <br /> max-width: 625px; <br /><span style="color: #000000;">}</span><br /><br />br <span style="color: #000000;">{</span><br /> clear: <span style="color: #000000;">both</span>; <br /> <span style="color: #000000;">}</span><br /></style><br /><br /><html><br /><form <span style="color: #0000ff;">ACTION</span>=<span style="color: #ff0000;">""</span> <br /> <span style="color: #0000ff;">name</span>=<span style="color: #ff0000;">"loginform"</span><br /> <span style="color: #00C800;">method</span>=<span style="color: #ff0000;">"post"</span> ><br /><br /> <div <span style="color: #0000ff;">id</span>=<span style="color: #ff0000;">"nav"</span>><br /> <strong>User Login</strong><br><br /><br><br /><br /><p><label <span style="color: #00C800;">for</span>=<span style="color: #ff0000;">"id"</span>> Username: </label></p><br /> <br /> <input type=<span style="color: #ff0000;">"text"</span> <span style="color: #0000ff;">name</span>=<span style="color: #ff0000;">"custid"</span>/><br /> <br /><p><label <span style="color: #00C800;">for</span> =<span style="color: #ff0000;">"pass"</span>> Password: </label></p><br /> <br /> <input type=<span style="color: #ff0000;">"password"</span> <span style="color: #0000ff;">name</span>=<span style="color: #ff0000;">"password"</span>/><br /> <br /> <br> <br /> <br><br /> <input type=<span style="color: #ff0000;">"submit"</span> <span style="color: #0000ff;">name</span>=<span style="color: #ff0000;">"submit"</span> value=<span style="color: #ff0000;">" Login "</span> <span style="color: #0000ff;">id</span>=<span style="color: #ff0000;">"subbutton"</span> /><br /> <br /> </div> <br /></form><br /></html><br /><br /><?php <br /><span style="color: #B900B9;">// include('include/header.php');</span><br /><span style="color: #B900B9;">// include('include/footer.php');</span><br /><br /><span style="color: #B900B9;">// echo '<div id="TextAreaHome"> ';</span><br /> echo <span style="color: #ff0000;">'<div id="wrapper">'</span>;<br /> <br /> include<span style="color: #000000;">(</span> <span style="color: #ff0000;">'include/home.txt'</span> <span style="color: #000000;">)</span>;<br /><br /> echo <span style="color: #ff0000;">'</div>'</span>;<br /> echo <span style="color: #ff0000;">'</div>'</span>;<br /><br />?> <br /><br /> </div>[/code:1ap9itha]
It will probably be easier to start by looking at the sample PHP web site from the help file. Then it is only a matter of learning PHP. Any PHP sample using mySQL will work the same, you only need to change the database functions to the respective ads_xxx function like you see on my code ads_execute(), ads_connect()... I wrote my only 2 web portals with PHP over 5 years ago. Haven't done many changes on them. The few times I have gone back to change something, it takes me a while to remember how to write PHP.
I hope that helps,
Reinaldo.
|
ADS Summit in Boise is now official
|
Dear Reinaldo,
Thank you so much for a well detailed explanation. It's a very good start.
I'm so interested with radPHP (embarcadero) because it's so simplified and the fact that we can combine [x]Harbour+FWH CGI app.
ADS released v11 with Php client. I should look dig into it as well as the 'web client' but as much as I can consume.. I would like to start with Php + ADS + FWH app fired in CGI/FastCGI.
Please continue your most informative information we all learned from.
Kind regards,
|
ADS Summit in Boise is now official
|
Darrell,
I just noticed that your online location says The Woodlands TX. I have been living there for about 20 years.
I also work in the transporation industry. Small world.
|
ADS Summit in Boise is now official
|
Hi Gale,
Most definitely! Please send me your contact details at <!-- e --><a href="mailto:Darrell.Ortiz@cdmsoft.com">Darrell.Ortiz@cdmsoft.com</a><!-- e -->
|
ADS Summit in Boise is now official
|
Dear Reinaldo,
Thank you for posting details about PHP and ADS. By any chance, do you have sample code related to autocomplete that includes look up to ADS/DBF with index file?
Sincerely,
|
ADS Summit in Boise is now official
|
Darrell;
I'm using a class named Autocomplete that inherits from TGet. The class was originally started by James Bott and it was pretty much his baby. It's been years and I can't remember how much I've change the class, but I do know it works with arrays as well as .dbf/cdx, .dbf/ntx, and .adt/adi. I feel James is owed the credit here so I'm afraid I can't post it.
BTW - you should seriously consider attending the summit. I'm sure you won't regret it. Same to Gale Ford, Roger Selik, Tim Stone, Rick Lipkin, James (who else is in NA?). We could eventually make this into a yearly xharbour summit.
Best regards,
Reinaldo.
|
ADS Summit in Boise is now official
|
Hello Reinaldo,
I agree about attending summit, however I already have commited to another trip. I would be very interested in attending xHarbour summit anywhere in the world, especially if Antonio and other wonderful forum supporters attend. I am constantly learning new tricks and tips from everyone on this forum.
Sincerely,
|
ADS Summit in Boise is now official
|
Reinaldo,
I tried to get info, dates, etc since last spring. They simply released the info too late. I realize its a "month" away but when I consider my total "out of the office" time this year, the conference will just not be doable this time.
I will again consider it for next year.
Tim
|
ADS Tips
|
Hello,
I think that it's goes being the moment that among all we go contributing our knowledge for somehow to be able to optimize the yield of ADS in our applications. I understand that the important thing is optimize the yield in the use of ADS in form Client/Server.
Many functions are not used or they are used bad. Does ADS work well, but can it work well? I believe that if it is possible. Today's tip
[b:3ts20iyp]Use of a type field it dates.[/b:3ts20iyp]
Usually using the function DToC (), does the system work and are we so wide, but that it happens if we use the function AdsGetDate ()? Do we notice difference?
[code:3ts20iyp]HB_FUNC( ZADSGETDATE )
{
ADSAREAP pArea;
UNSIGNED8 *pucFldName = (UNSIGNED8 *) hb_parc( 1 );
UNSIGNED8 pucBuf[16];
UNSIGNED16 pusLen = 16;
pArea = (ADSAREAP) hb_rddGetCurrentWorkAreaPointer();
/* ulRetVal = AdsGetServerName( hConnect,pucname,&puslen ) ; */
AdsGetDate( pArea->hTable, pucFldName, pucBuf, &pusLen );
if( pusLen > 0 )
{
hb_retc( (char *) pucBuf );
}
else
{
hb_retc(NULL);
}
}
[/code:3ts20iyp]
Y su uso en un browse seria:
[code:3ts20iyp]@0, 0 LISTBOX oLbx ;
FIELDS (cAlias)->order ,;
(cAlias)->( ZAdsGetDate( 'mydate' ) ) ;
HEADER 'Order', 'Date' ;
FONT oFont ALIAS cAlias SIZE 200,200 PIXEL OF oWnd
[/code:3ts20iyp]
Note: It's interesting to carry out the tests with big tables and against Client/Server
I hope to encourage people to contribute their tips and among all to achieve a bigger yield of ADS
|
ADS Tips
|
Hola,
Despues de leer el hilo <!-- m --><a class="postlink" href="http://fivetechsoft.com/forums/viewtopic.php?t=9343">http://fivetechsoft.com/forums/viewtopic.php?t=9343</a><!-- m --> , pienso que va siendo el momento de que entre todos vayamos aportando nuestros conocimientos para poder de alguna manera optimizar el rendimiento de ADS en nuestras aplicaciones. Entiendo que lo importante es optimizar el rendimiento en el uso de ADS en forma Cliente / Servidor.
Muchas funciones no se usan o se usan mal. ADS funciona bien, pero puede funcionar mejor ? Creo que si es posible. Mi tip de hoy
[b:1ddgs24q]Uso de un campo de tipo fecha.[/b:1ddgs24q]
Normalmente usando la funcion DToC(), el sistema funciona y nos quedamos tan anchos, pero que pasa si usamos la funcion AdsGetDate() ? Notamos diferencia ?
[code:1ddgs24q]HB_FUNC( ZADSGETDATE )
{
ADSAREAP pArea;
UNSIGNED8 *pucFldName = (UNSIGNED8 *) hb_parc( 1 );
UNSIGNED8 pucBuf[16];
UNSIGNED16 pusLen = 16;
pArea = (ADSAREAP) hb_rddGetCurrentWorkAreaPointer();
/* ulRetVal = AdsGetServerName( hConnect,pucname,&puslen ) ; */
AdsGetDate( pArea->hTable, pucFldName, pucBuf, &pusLen );
if( pusLen > 0 )
{
hb_retc( (char *) pucBuf );
}
else
{
hb_retc(NULL);
}
} [/code:1ddgs24q]
Y su uso en un browse seria:
[code:1ddgs24q]@0, 0 LISTBOX oLbx ;
FIELDS (cAlias)->order ,;
(cAlias)->( ZAdsGetDate( 'mydate' ) ) ;
HEADER 'Order', 'Date' ;
FONT oFont ALIAS cAlias SIZE 200,200 PIXEL OF oWnd
[/code:1ddgs24q]
Nota: Es interesante realizar las pruebas con grandes tablas y contra Cliente/Servidor
Espero animar a la gente aportar sus tips y entre todos lograr un mayor rendimiento de ADS
|
ADS Tips
|
Hola carlesComo puedo incluir esta rutina en mi aplicaciónlo estoy haciendo de esta manera pero me salen muchos errores[code:2vhq24kh]#pragma BEGINDUMP
#include "hbapi.h"
#include "hbinit.h"
#include "hbapiitm.h"
#include "hbapierr.h"
#include "hbdbferr.h"
#include "hbapilng.h"
#include "hbdate.h"
#include "rddads.h"
#include "hbset.h"
#include "hbvm.h"
#include "rddsys.ch"
HB_FUNC( ZADSGETDATE )
{
ADSAREAP pArea;
UNSIGNED8 *pucFldName = (UNSIGNED8 *) hb_parc( 1 );
UNSIGNED8 pucBuf[16];
UNSIGNED16 pusLen = 16;
pArea = (ADSAREAP) hb_rddGetCurrentWorkAreaPointer();
/* ulRetVal = AdsGetServerName( hConnect,pucname,&puslen ) ; */
AdsGetDate( pArea->hTable, pucFldName, pucBuf, &pusLen );
if( pusLen > 0 )
{
hb_retc( (char *) pucBuf );
}
else
{
hb_retc(NULL);
}
}
#pragma ENDDUMP[/code:2vhq24kh]
[code:2vhq24kh]
Lines 1191, Functions/Procedures 31
Generating C source output to 'obj\General.c'...
Done.
c:\borland\bcc55\bin\bcc32 -c -tWM -Ic:\harbour\include -oobj\Genera
j\General.c
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
obj\General.c:
Error E2141 c:\harbour\include\ace.h 1242: Declaration syntax error
Error E2293 c:\harbour\include\ace.h 1243: ) expected
Error E2141 c:\harbour\include\ace.h 1246: Declaration syntax error
Error E2293 c:\harbour\include\ace.h 1247: ) expected
Error E2141 c:\harbour\include\ace.h 1250: Declaration syntax error
Error E2293 c:\harbour\include\ace.h 1251: ) expected
Error E2141 c:\harbour\include\ace.h 1254: Declaration syntax error
Error E2293 c:\harbour\include\ace.h 1256: ) expected
Error E2141 c:\harbour\include\ace.h 1259: Declaration syntax error
Error E2293 c:\harbour\include\ace.h 1261: ) expected
Error E2141 c:\harbour\include\ace.h 1264: Declaration syntax error[/code:2vhq24kh]nota: he copiado los archivos ace.h y rddads.h al directorio c:\harbour\include desde los fuentes de contrib
|
ADS Tips
|
Hola,[b:1kqm31nz]Uso de fecha[/b:1kqm31nz]Va bastante mejor que Date() y además la fecha que devuelve es la del servidor, no la del equipo[code:1kqm31nz]FUNCTION Fech()
local cAds, dDate
cAds := AdsGetServerTime()[1]
dDate := ctod( cAds )
return dDate[/code:1kqm31nz]
|
ADS Triggers
|
Hello,
have some body experiences with ADS triggers?, I am trying to develop a system loger, with trigger can be really easy, but the problem
is how can I send extra parameter to a trigger, is possible to obtain the date and the time to save the history data, but I don't know how can I send
the user information.
regards
Marcelo
|
ADS Triggers
|
Hi.
I use ADS triggers extensively.
ADS triggers can receive __new and __old cursors containing the new and the old data. For time and date, you wouldn't need to send anything. You can always use the ADS SQL engine function now(). As in UPDATE table SET dt_field = now(). If the table is ADT or DBF /CDX, then you could have a field type datetime that defaults to now() - then you wouldn't even have to worry about ever writing to that field.
Look at this trigger as a sample. It has many things:
[code=fw:16e33me3]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> declare @is_email LOGICAL;<br /> declare @email CHAR<span style="color: #000000;">(</span><span style="color: #000000;">100</span><span style="color: #000000;">)</span>;<br /><br /> declare @is_hosp_email LOGICAL;<br /> declare @hosp_email CHAR<span style="color: #000000;">(</span><span style="color: #000000;">100</span><span style="color: #000000;">)</span>;<br /> <br /> declare @old <span style="color: #0000ff;">cursor</span> as <span style="color: #0000ff;">select</span> * <span style="color: #0000ff;">from</span> __old; <br /> declare @<span style="color: #00C800;">new</span> <span style="color: #0000ff;">cursor</span> as <span style="color: #0000ff;">select</span> * <span style="color: #0000ff;">from</span> __new;<br /><br /> open @old; <br /> fetch @old;<br /> open @<span style="color: #00C800;">new</span>; <br /> fetch @<span style="color: #00C800;">new</span>;<br /> <br /> <span style="color: #00C800;">if</span> @<span style="color: #00C800;">new</span>.signed = <span style="color: #00C800;">TRUE</span> AND @old.signed = <span style="color: #00C800;">FALSE</span> then<br /> <br /> @is_email = <span style="color: #000000;">(</span> <span style="color: #0000ff;">SELECT</span> is_email <span style="color: #0000ff;">from</span> doctors <span style="color: #0000ff;">where</span> doctors.<span style="color: #0000ff;">id</span> = @<span style="color: #00C800;">new</span>.refer_id <span style="color: #000000;">)</span>; <br /> @email = <span style="color: #000000;">(</span> <span style="color: #0000ff;">SELECT</span> email <span style="color: #0000ff;">from</span> doctors <span style="color: #0000ff;">where</span> doctors.<span style="color: #0000ff;">id</span> = @<span style="color: #00C800;">new</span>.refer_id <span style="color: #000000;">)</span>;<br /><br /> <span style="color: #00C800;">if</span> @is_email = <span style="color: #00C800;">TRUE</span> AND @email IS NOT <span style="color: #00C800;">NULL</span> then<br /> <br /> INSERT INTO plmail <span style="color: #000000;">(</span> pathno, doc_id, send_to <span style="color: #000000;">)</span> <br /> VALUES <span style="color: #000000;">(</span> @<span style="color: #00C800;">new</span>.pathno, @<span style="color: #00C800;">new</span>.refer_id,<br /> <span style="color: #000000;">(</span> <span style="color: #0000ff;">SELECT</span> email <span style="color: #0000ff;">FROM</span> doctors <br /> <span style="color: #0000ff;">WHERE</span> doctors.<span style="color: #0000ff;">id</span> = @<span style="color: #00C800;">new</span>.refer_id <br /> AND doctors.is_email = <span style="color: #00C800;">TRUE</span> <br /> AND doctors.email IS NOT <span style="color: #00C800;">NULL</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>; <br /> <br /> INSERT INTO plmail <span style="color: #000000;">(</span> pathno, doc_id, send_to <span style="color: #000000;">)</span> <br /> <span style="color: #0000ff;">SELECT</span> c.pathno, c.copyto, doc.email <span style="color: #0000ff;">FROM</span> copyto c <br /> <span style="color: #0000ff;">LEFT</span> <span style="color: #0000ff;">JOIN</span> doctors doc <span style="color: #0000ff;">ON</span> doc.<span style="color: #0000ff;">id</span> = c.copyto<br /> <span style="color: #0000ff;">WHERE</span> c.pathno = @<span style="color: #00C800;">new</span>.pathno <br /> AND doc.is_email = <span style="color: #00C800;">TRUE</span> <br /> AND doc.email IS NOT <span style="color: #00C800;">NULL</span> ;<br /> <br /> <span style="color: #00C800;">endif</span> ;<br /><br /> <span style="color: #00C800;">if</span> @<span style="color: #00C800;">new</span>.facility IS NOT <span style="color: #00C800;">NULL</span> then <br /> @is_hosp_email = <span style="color: #000000;">(</span> <span style="color: #0000ff;">SELECT</span> TOP <span style="color: #000000;">1</span> is_email <span style="color: #0000ff;">from</span> hospital <span style="color: #0000ff;">where</span> hospital.<span style="color: #0000ff;">name</span> = @<span style="color: #00C800;">new</span>.facility <span style="color: #000000;">)</span>; <br /> @hosp_email = <span style="color: #000000;">(</span> <span style="color: #0000ff;">SELECT</span> TOP <span style="color: #000000;">1</span> e_mail <span style="color: #0000ff;">from</span> hospital <span style="color: #0000ff;">where</span> hospital.<span style="color: #0000ff;">name</span> = @<span style="color: #00C800;">new</span>.facility <span style="color: #000000;">)</span>;<br /><br /> <span style="color: #00C800;">if</span> @is_hosp_email = <span style="color: #00C800;">TRUE</span> AND @hosp_email IS NOT <span style="color: #00C800;">NULL</span> then <br /> INSERT INTO plmail <span style="color: #000000;">(</span> pathno, doc_id, send_to <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">SELECT</span> @<span style="color: #00C800;">new</span>.pathno, h.passwd, h.e_mail <span style="color: #0000ff;">from</span> hospital h<br /> <span style="color: #0000ff;">WHERE</span> h.<span style="color: #0000ff;">name</span> = @<span style="color: #00C800;">new</span>.facility ;<br /> <span style="color: #00C800;">endif</span>;<br /> <span style="color: #00C800;">endif</span>;<br /> <span style="color: #00C800;">endif</span>;<br /><br /> <span style="color: #00C800;">if</span> @<span style="color: #00C800;">new</span>.signed = <span style="color: #00C800;">FALSE</span> AND @old.signed = <span style="color: #00C800;">TRUE</span> then<br /> DELETE <span style="color: #0000ff;">FROM</span> plmail <br /> <span style="color: #0000ff;">WHERE</span> pathno = @<span style="color: #00C800;">new</span>.pathno <br /> AND DateTime_Sent IS <span style="color: #00C800;">NULL</span> ;<br /><br /> DELETE <span style="color: #0000ff;">FROM</span> pthreps <br /> <span style="color: #0000ff;">WHERE</span> pathno = @<span style="color: #00C800;">new</span>.pathno;<br /><br /> <span style="color: #00C800;">endif</span> ;<br /> </div>[/code:16e33me3]
|
ADS Triggers
|
Reinaldo,
thanks you very much for your sample, the date and time is possible obtain across ADS function, but I need to save the user name who is lunch the operation, are there the possibility to send an parameter, like user name?
regards
Marcelo
|
ADS Triggers
|
No that I know of.
However, after connecting to the DD you could change property appid to the username or to username+_+appid. With that, you can always query appid() and parse the result to extract the user name. Another good thing about doing this, is that now you also have the user name displayed on one of the columns on the "remote info" option of arc32.
Look for sp_SetApplicationID() and sp_GetApplicationID() on the help file.
Hope that helps,
Reinaldo.
|
ADS Versions
|
I have been working with ADS for many years. With the assistance of some people, I have managed to obtain drivers to work with ADS 7, 8, and 9. This includes a linked library that supports all 3 sets of drivers.
When version 10 came out, it would not work. I was told it contained too many changes.
So here is my problem. I have clients on ADS 7, 8, and 9 and would like to now use 10. Can anyone provide guidance on bridging this problem ? I'm using xHarbour ( .com, Aug 2010 ) with FWH 12.04
And a second question. I was able to get a product build using Harbour, FWH 12.04, and MSVC 2010. I had to limit it to DBFCDX to work. Can anyone provide documentation on ADS libs for Harbour ( current Five Tech built version ) ?
Thanks.
|
ADS Versions
|
Tim,
You can use last harbour for MVC with ADS, you need to use last ADS 10 Dll, do not combine with other versions of DLL because some problems occurs, i have an academic system compiled with last xHarbour and Harbour builds with BCC63 and Last Harbour build With MVC 2010 With ADS and all working fine, local or remote.
I'am using FWH 1105, using libs patchs for last harbour.
You can get last rddads.lib for boths xharbour and harbour in fivewin contribs.
Regards,
|
ADS Versions
|
Thank you for that information. I did the build and I receive over 200 unresolved externals related to rddads.lib ( adsfunc.obj ).
When using xHarbour ( xCC ), I have to include ACE32.lib, but there is no such lib available in FWH or Harbour. Is that needed here, and if so, where is a resource for it ?
Tim
|
ADS Versions
|
Tim,
I am using ace32.lib coming with aceapi downloaded from <!-- m --><a class="postlink" href="http://devzone.advantagedatabase.com">http://devzone.advantagedatabase.com</a><!-- m --> those lib work with fine whit XCC and MVC.
You can download my libs ace32.lib and rddads.lib
[url:kfzw5sf6]http://190.90.160.205/pruebas/ads_mvc.zip[/url:kfzw5sf6]
Regards,
|
ADS Versions
|
Tim,
You can download aceapi from this link advantage client engine.
[url:2vb3e2i7]http://devzone.advantagedatabase.com/dz/content.aspx?key=20&Release=16&Product=5[/url:2vb3e2i7]
Regards,
|
ADS Versions
|
Thank you for the file reference. I had already downloaded and tried the files from the ADS developers page.
|
ADS Versions
|
Tim,
Do you solve your issues ?
Regards,
|
ADS Versions
|
I don't know. I have a different problem, and so I can't get the build to run properly. I don't believe its related to this ... its likely something in my configuration that I will have to resolve. I will report back once I isolate that problem and fix it.
Tim
|
ADS Versions
|
Hi Tim, and everyone else interested on this subject.
To use ADS ver x you need ACE32.dll version x as well as include files for that version. From ACE32.dll x you can build ACE32.lib version x (if necessary).
To build different rdd_ads.lib for each version it makes sense to have the needed files for each target build version on its own directory. For example:
c:\ads10\acesdk
c:\ads9\acesdk
c:\ads8\acesdk
...
You can obtain each acesdk from the advantage devzone as pointed earlier on this thread. To build rdd_ads.lib for each you only need to set HB_DIR_ADS environment variable to point to the correct acesdk subdirectory. After that simply execute the batch file that creates the lib.
For example to create rdd_ads.lib for ads 10 and xharbour 1.2.xxxx do this:
cd \xharbour_1.2.xxxx\contrib\rdd_ads
set HB_DIR_ADS = c:\ads10\acesdk
make_b32.bat
That's it. The developers of harbour have made the process a lot simpler than it used to be. That should work for any harbour or xharbour version. The only exception would be xhb.com. I have no idea how the commercial xhb.com works. But I'm sure they do and as a commercial product you should be able to get support.
You can now link the newly created .lib to your app and use any of the ace32 version 10 functions that have been ported to adsfuncs.c. Including all the new stored procedures and sql commands (such as MERGE! -I couldn't live without it). While you are at it, I highly recommend learning to use ADS data dictionary. It totally opens a whole new world for dbf -data security, extended field types, SQL, moving a lot of the business logic to the server side using referential integrity, data ranges, valid values, default values, triggers, stored procedures... Even for single user apps or apps used by very few users, it makes a huge difference.
If you are only using the local server, then simply upgrade to version 10 and distribute your newly linked app with version 10 ace32.dll and adslocal32.dll and take advantage of all that's new that is also available on the local server. In this case (local server), I see no need to build multiple versions, just go straight to the latest available version.
Hope that helps.
BTW -I encourage any N.America xharbour/harbour + ADS developer to make plans and come to Boise this next Oct for their next ADS summit. The product manager for ADS at Sybase has expressed interest in creating a summit just for harbour developers. He has even expressed the possibility of bringing Antonio to the summit. The problem is that I have never been able to find more than 3 developers committed to assisting. If enough of us show up, I'm sure we can capture their attention. IMHO, all they need to do is distribute each different version of rdd_ads.lib for each compiler and ads version. That alone would ease the hump of starting to use ADS with harbour.
Reinaldo.
|
ADS Versions
|
... and one last thing; Even for ADS remote server (real client-server) customers, I don't think you need to create new or different rdd_ads.lib to link with your apps. The very same old rdd_ads.lib liked with your old apps will work with thew new server .dlls. The exception would be that you are now calling some new ACE function from your apps. So again, simply distribute the new (version 10) .dlls to your customers with your same old app and it should work just fine. In short, old clients work with newer servers (but not the opposite). So if you are not planning on using any of the new ACE stuff, then keep using the same .libs as usual.
Reinaldo.
|
ADS Versions
|
Reinaldo,
My clients are scattered from ADS 7 to 9. It is not practical to do a separate build for each ace32.lib level. I do automatic updating and that would be a nightmare. Some might upgrade to 10, but 11 is now in beta. Pretty soon I lose credibility ! They can't see a difference. They pay me for upgrades to my software, but they continually see new features and enhancements.
I had an ACE32.lib that works for 7 through 9. However, apparently 10 changed the game too much.
Also, I have to include drivers for each version ( the .dll files ). In my experience, a version 9 driver will NOT work with an installed ADS 8 server. However, the updates are usually the .exe file and that is not dependent on the drivers. Once they are installed, they remain.
I would be willing to go to Boise in October.
Tim
|
ADS Versions
|
"In my experience, a version 9 driver will NOT work with an installed ADS 8 server. "
Exactly. Newer client will not work with older server. But if you keep version 7 of the client, it will work with 7, 8, 9, 10 of the server. Again; newer client will **not** work with older server but older client WILL work with newer server.
Reinaldo.
|
ADS Versions
|
So you are saying an ACE32.lib from 7 will work with any server ?
Or more to the point, my ACE32.lib that supports 7/8/9, if I couple it with the 7 .dll, should work with ADS 10 ?
I was led to believe that was not the case with 10.
Tim
|
ADS Versions
|
This is generally true. Any older version of the client will work with any newer version of the server. With version 10 there is only one caveat -but only if you also update the client as well as the server to version 10 (I know it sounds weird). It should only affect you if you are using data dictionaries (highly recommended). Here it is from the help file:
In order to restore the previous (pre-version 10.0) behavior to your application, it is necessary to call the Advantage Client Engine API AdsSetRightsChecking. This new behavior requires the v10.0 client. Older clients are not affected by this change in behavior.
5004 Errors Opening Static Cursors from ACE 2.7/5.7 and Older Clients
Rights checking must be disabled on 5.7 and older clients when using an Advantage version 10 server. Version 10 uses a combination of data caching and temporary file handle pooling, and these technologies are not compatible with 5.7 and older clients as they attempt to verify the existence of the physical temporary file when opening a static cursor.
So again, you can change the server and never touch your app. I do it all the time.
Reinaldo.
|
ADS Y PHP
|
Estoy intentando configurar ADS 10.10.0.49 sobre php 5.3.28 y IIS 7.
Pero no consigo ponerlo en marcha.
He copiado el archivo php_advantage.dll.5.3.26.VC9 a la carpeta "php\v5.3\ext" (Renombrado a php_advantage.dll)
He incluido en el php.ini la extensión extension=php_advantage.dll
Tambien he copiado el contenido de la carpeta Redistribute, tanto a windows\system32, como a php\v5.3
He reiniciado el servicio y no consigo ni conectarme a un add, ni que me devuelva las funciones que hay.
[code=fw:2801u453]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><?PHP<br />Echo <span style="color: #ff0000;">"inicio2<P>"</span>;<br />$functions = get_extension_funcs<span style="color: #000000;">(</span><span style="color: #ff0000;">'advantage'</span><span style="color: #000000;">)</span>;<br />Echo <span style="color: #ff0000;">"connect<P>"</span>;<br />foreach <span style="color: #000000;">(</span>$functions as $func<span style="color: #000000;">)</span><br /> echo $func.<span style="color: #ff0000;">"<br>"</span>;<br />echo <span style="color: #ff0000;">"<br>"</span>;<br />Echo <span style="color: #ff0000;">"adios<P>"</span>;<br />?></div>[/code:2801u453]
|
ADS Y PHP
|
Master,
si haces un <?php phpinfo(); ?> , aparece cargado el módulo?
Mira en el log si hay alguna entrada que diga algo respecto a que no puede cargar el módulo o algo relacionado.
Un saludo
|
ADS Y PHP
|
Good morning Fernando;
All of my web server installations are done on Apache under Linux (which is actually more complicated to setup), so I'm probably not the best person to help with IIS problems but setting up IIS with PHP for ADS is supposed to be really simple.
A couple of things come to mind:
1. did you set in the php.ini file extension_dir to point to ext directory? -This is the most likely culprit.
2. did you build the library yourself or did you download from web?
At any rate, if this doesn't help then I suggest you take the problem to the advantage dev forum. Being that this has nothing to do with fwh, I'm sure you will find help here: [url:2vzdm0uj]http://devzone.advantagedatabase.com/forum/tags/php/[/url:2vzdm0uj]
Hope to learn you solved this problem soon and have your dbf data exposed to the web using PHP.
Reinaldo.
|
ADS Y PHP
|
Hola,
Muchas gracias por las respuesta.
Ya he conseguido hacerlo funcionar.
He tenido que descargar la versión 5.3.26 de PHP para windows, que es la misma que php_advantage.dll
Además he copiado todo el contenido de redistribute de advantage en la carpeta donde esta instalado php.
|
ADS and DATA DICTIONARY
|
Hello,
When working with [b:2bl9vlph]tables in a Data Dictionary[/b:2bl9vlph], how do you reindex and create indexes?.
Thank you very much.
Best regards,
Lucas
|
ADS and DATA DICTIONARY
|
Hello,
you can use a Store Procedure to do that
sp_CreateIndex
sp_CreateIndex90
regards
Marcelo
|
ADS and DATA DICTIONARY
|
Hello Marcelo,
thanks for reply.
But you don´t use INDEX ON TO..?.
Please, can I see a piece of code?.
Thank you very much.
|
ADS and DATA DICTIONARY
|
Hola,
from the ADS help file
sp_CreateIndex( TableName,CHARACTER,515,
FileName,CHARACTER,515,
TagName,CHARACTER,128,
Expression,CHARACTER,510,
Condition,CHARACTER,510,
Options,INTEGER,
PageSize,INTEGER );
|
ADS and DATA DICTIONARY
|
Hello,
And how do you reindex?.
Thank you
|
ADS and DATA DICTIONARY
|
From the help file too, and with sample at the end of the page
[quote:x8k61pse]Rebuilds all auto-open indexes associated with the given table.
Syntax
sp_Reindex( TableName,CHARACTER,515,
PageSize, INTEGER )
Parameters
TableName (I)
Name of table to rebuild indexes on. This can include path information for free tables if the table is in a different folder from the connection path.
PageSize (I)
The page size to use when rebuilding indexes on ADT tables. This is ignored for other table types. If the value 0 is given, the existing page size is used. Valid page sizes can be any value from 512 to 8192. Refer to Index Page Size and Index Key Size and Page Size Relationships for more information. Note that if the table is in an Advantage Data Dictionary, then only the administrator connection can be used to change the page size when reindexing a table.
Remarks
sp_Reindex rebuilds all auto-open indexes associated with the given table. Because the reindex operation requires exclusive access to the table, no other connections can have the table open when this is called.
Example
-- Rebuild all auto-open indexes on mytable with a page size of 1024
EXECUTE PROCEDURE sp_Reindex( 'mytable.adt', 1024 );
[/quote:x8k61pse]
|
ADS and DATA DICTIONARY
|
Lukas
Si las tablas ya tienen index puedes usar esto
[code=fw:1ffq8gba]<div class="fw" id="{CB}" style="font-family: monospace;"> aIndex := AdsDirectory<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">for</span> i := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> len<span style="color: #000000;">(</span> aIndex <span style="color: #000000;">)</span><br /> cDbf := <span style="color: #0000ff;">Left</span><span style="color: #000000;">(</span> aIndex<span style="color: #000000;">[</span>i<span style="color: #000000;">]</span>, len<span style="color: #000000;">(</span> aIndex<span style="color: #000000;">[</span>i<span style="color: #000000;">]</span> <span style="color: #000000;">)</span><span style="color: #000000;">-1</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> Netuse<span style="color: #000000;">(</span> cDbf, .f. <span style="color: #000000;">)</span> <span style="color: #B900B9;">//abrimo la tabla exclusivo</span><br /> PACK<br /> <span style="color: #00C800;">if</span> ADSGETNUMINDEXES<span style="color: #000000;">(</span><span style="color: #000000;">)</span> > <span style="color: #000000;">0</span> <span style="color: #B900B9;">// revisamos si la tabla tiene indice</span><br /> AdsReindex<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">//reindexamo</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /> USE<br /> <span style="color: #00C800;">next</span> i</div>[/code:1ffq8gba]
|
ADS and DATA DICTIONARY
|
esto lo hice a partir del ejemplo anterior.
[code=fw:1jt7denx]<div class="fw" id="{CB}" style="font-family: monospace;"><br />PROCEDURE Reorganizar<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> cTabla<br /> <span style="color: #00C800;">LOCAL</span> aTablas<br /> <span style="color: #00C800;">LOCAL</span> oError<br /><br /> <span style="color: #00C800;">IF</span> !MsgNoYes<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Para realizar este proceso, ningun usuario debe estar conectado al programa, desea continuar?"</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">RETURN</span><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> <span style="color: #00C800;">IF</span> !ADSRunSQL<span style="color: #000000;">(</span> <span style="color: #ff0000;">"TABLAS"</span>, <span style="color: #ff0000;">"SELECT * FROM SYSTEM.TABLES"</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">RETURN</span><br /> <span style="color: #00C800;">ELSE</span><br /> aTablas := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /> TABLAS-><span style="color: #000000;">(</span> DBEval<span style="color: #000000;">(</span> <span style="color: #000000;">{</span>|| AAdd<span style="color: #000000;">(</span> aTablas, RTrim<span style="color: #000000;">(</span> FIELD->NAME <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span>, DBCloseArea<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> Len<span style="color: #000000;">(</span> aTablas <span style="color: #000000;">)</span> = <span style="color: #000000;">0</span><br /> TABLA-><span style="color: #000000;">(</span>dbclosearea<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">RETURN</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> WaitOn<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Cerrando tablas..."</span> <span style="color: #000000;">)</span><br /> DbCloseAll<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> WaitOff<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> WaitOn<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Reorganizando datos..."</span> <span style="color: #000000;">)</span><br /> CursorWait<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">FOR</span> EACH cTabla IN aTablas<br /> <span style="color: #00C800;">TRY</span><br /> USE <span style="color: #000000;">(</span>cTabla<span style="color: #000000;">)</span> <span style="color: #00C800;">NEW</span> EXCLUSIVE<br /> <span style="color: #00C800;">IF</span> !NetErr<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> AdsGetNumIndexes<span style="color: #000000;">(</span><span style="color: #000000;">)</span> > <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">IF</span> !AdsReindex<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> AdsGetLastError<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #ff0000;">"Usuario"</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">ENDIF</span><br /> DBCloseArea<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> CATCH oError<br /> MsgAlert<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Error reorganizando información en tabla en: "</span> + Upper<span style="color: #000000;">(</span> cTabla <span style="color: #000000;">)</span> + FINL + oError:<span style="color: #000000;">Description</span> <span style="color: #000000;">)</span><br /> END<br /> <span style="color: #00C800;">NEXT</span><br /><br /> CursorArrow<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> WaitOff<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> MsgRun<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Espere un momento, abriendo nuevamente tablas de datos."</span>, <span style="color: #ff0000;">"CREDICOM"</span>, <span style="color: #000000;">{</span>|| Conectar_AbrirTablas<span style="color: #000000;">(</span> <span style="color: #00C800;">TRUE</span>, <span style="color: #00C800;">TRUE</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span><br /> </div>[/code:1jt7denx]
|
ADS and DATA DICTIONARY
|
Hello,
Thank you both very much, Patricio and Carlos.
The point is that with a Data Dictionary INDEX ON TO.. does not work. AdsReindex() should be used instead. But I could not find this nor in the documentation nor in Rene Flore´s manual.
Using Remote or Local server works the same as RDDCDX, but not when using a data dictionary.
Thanks a lot!!!
|
ADS and DATA DICTIONARY
|
en un diccionario es necesario usar la funciones
EXECUTE PROCEDURE sp_CreateIndex90(
'caja',
'caja.adi',
'NUM_CIUD',
'num_ciud',
'',
2,
512,
'' );
|
ADS and DATA DICTIONARY
|
creacion por codigo de un dd, talas e indices.
salu2
[code=fw:3i2jn7xa]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">/*<br /> Demo of ADS Connection handling and Data Dictionaries<br />*/</span><br /><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"ads.ch"</span><br />REQUEST ADS<br /><br /><span style="color: #00C800;">FUNCTION</span> MAIN<br /> <span style="color: #00C800;">local</span> n<br /> <span style="color: #00C800;">local</span> cErr, cStr<br /> <span style="color: #00C800;">local</span> aStru := <span style="color: #000000;">{</span><span style="color: #000000;">{</span> <span style="color: #ff0000;">"ID"</span>, <span style="color: #ff0000;">"A"</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span><span style="color: #000000;">}</span>, <span style="color: #000000;">{</span><span style="color: #ff0000;">"Name"</span>, <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">50</span>, <span style="color: #000000;">0</span><span style="color: #000000;">}</span>, <span style="color: #000000;">{</span><span style="color: #ff0000;">"address"</span>, <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">50</span>, <span style="color: #000000;">0</span><span style="color: #000000;">}</span>, <span style="color: #000000;">{</span><span style="color: #ff0000;">"city"</span>, <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">30</span>, <span style="color: #000000;">0</span><span style="color: #000000;">}</span>, <span style="color: #000000;">{</span><span style="color: #ff0000;">"Age"</span>, <span style="color: #ff0000;">"n"</span>, <span style="color: #000000;">3</span>, <span style="color: #000000;">0</span><span style="color: #000000;">}</span><span style="color: #000000;">}</span><br /> <span style="color: #00C800;">local</span> hConnection1, hConnection2<br /> <span style="color: #00C800;">local</span> lIsDict := .f.<br /><br /> CLS<br /><br /> RddSetDefault<span style="color: #000000;">(</span><span style="color: #ff0000;">"ADT"</span><span style="color: #000000;">)</span><br /> AdsSetServerType <span style="color: #000000;">(</span> <span style="color: #000000;">7</span> <span style="color: #000000;">)</span><br /> SET Filetype <span style="color: #0000ff;">to</span> ADT<br /><br /> ? <span style="color: #ff0000;">"Default connection is 0:"</span>, adsConnection<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> fErase<span style="color: #000000;">(</span><span style="color: #ff0000;">"xharbour.add"</span><span style="color: #000000;">)</span><br /> fErase<span style="color: #000000;">(</span><span style="color: #ff0000;">"xharbour.ai"</span><span style="color: #000000;">)</span><br /> fErase<span style="color: #000000;">(</span><span style="color: #ff0000;">"xharbour.am"</span><span style="color: #000000;">)</span><br /> fErase<span style="color: #000000;">(</span><span style="color: #ff0000;">"Table1.adt"</span><span style="color: #000000;">)</span><br /> fErase<span style="color: #000000;">(</span><span style="color: #ff0000;">"Table1.adi"</span><span style="color: #000000;">)</span><br /> fErase<span style="color: #000000;">(</span><span style="color: #ff0000;">"Table2.adt"</span><span style="color: #000000;">)</span><br /> fErase<span style="color: #000000;">(</span><span style="color: #ff0000;">"Table2.adi"</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">// now Create a Data dictionary and the files if not exist</span><br /> <span style="color: #00C800;">IF</span> !File<span style="color: #000000;">(</span><span style="color: #ff0000;">"xharbour.add"</span><span style="color: #000000;">)</span><br /> ADSDDCREATE<span style="color: #000000;">(</span><span style="color: #ff0000;">"xharbour.add"</span>,, <span style="color: #ff0000;">"Xharbour ADS demo for data dictionary"</span><span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">// This also creates an Administrative Handle that is set as the default</span><br /> ? <span style="color: #ff0000;">"Default connection is now this admin handle:"</span>, adsConnection<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> AdsDisconnect<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">// disconnect current default.</span><br /> <span style="color: #B900B9;">// if you wanted to retain this connection for later, you could use</span><br /> <span style="color: #B900B9;">// hAdminCon := adsConnection(0)</span><br /> <span style="color: #B900B9;">// This get/set call would return the current connection, then set it to 0</span><br /><br /> ? <span style="color: #ff0000;">"Default connection is now this handle (zero):"</span>, adsConnection<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">// now create two free tables with same structure</span><br /> DbCreate<span style="color: #000000;">(</span><span style="color: #ff0000;">"Table1"</span>, aStru<span style="color: #000000;">)</span><br /> DbCreate<span style="color: #000000;">(</span><span style="color: #ff0000;">"Table2"</span>, aStru<span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">//now create an index</span><br /> USE table1 <span style="color: #00C800;">new</span><br /> <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">id</span> TAG codigo<br /> USE<br /><br /> USE table2 <span style="color: #00C800;">new</span><br /> <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">id</span> TAG codigo<br /> USE<br /> <span style="color: #00C800;">ENDIF</span><br /><br /> <span style="color: #B900B9;">// now the magic</span><br /> <span style="color: #00C800;">IF</span> adsConnect60<span style="color: #000000;">(</span><span style="color: #ff0000;">"xharbour.add"</span>, <span style="color: #000000;">7</span><span style="color: #B900B9;">/* All types of connection*/</span>, <span style="color: #ff0000;">"ADSSYS"</span>, <span style="color: #ff0000;">""</span>, , @hConnection1 <span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">// The connection handle to xharbour.add is now stored in hConnection1,</span><br /> <span style="color: #B900B9;">// and this is now the default connection</span><br /><br /> ? <span style="color: #ff0000;">"Default connection is now this handle:"</span>, adsConnection<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ? <span style="color: #ff0000;">" Is it a Data Dict connection? (ADS_DATABASE_CONNECTION=6, "</span><br /> ? <span style="color: #ff0000;">" ADS_SYS_ADMIN_CONNECTION=7):"</span>, AdsGetHandleType<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">// Add one user</span><br /> AdsDDCreateUser<span style="color: #000000;">(</span>, <span style="color: #ff0000;">"Luiz"</span>, <span style="color: #ff0000;">"papael"</span>, <span style="color: #ff0000;">"This is user Luiz"</span><span style="color: #000000;">)</span><br /><br /><br /> <span style="color: #00C800;">IF</span> adsddGetUserProperty<span style="color: #000000;">(</span><span style="color: #ff0000;">"Luiz"</span>, ADS_DD_COMMENT, @cStr, hConnection1<span style="color: #000000;">)</span><br /> ? <span style="color: #ff0000;">"User comment:"</span>, cStr<br /> <span style="color: #00C800;">ELSE</span><br /> ? <span style="color: #ff0000;">"Error retrieving User comment"</span><br /> <span style="color: #00C800;">ENDIF</span><br /><br /><br /> ? <span style="color: #ff0000;">"Add the tables"</span><br /> AdsDDaddTable<span style="color: #000000;">(</span><span style="color: #ff0000;">"Table1"</span>, <span style="color: #ff0000;">"table1.adt"</span>, <span style="color: #ff0000;">"table1.adi"</span><span style="color: #000000;">)</span><br /> ?<br /> <span style="color: #00C800;">IF</span> ! AdsDDaddTable<span style="color: #000000;">(</span><span style="color: #ff0000;">"Customer Data"</span>, <span style="color: #ff0000;">"table2.adt"</span>, <span style="color: #ff0000;">"table2.adi"</span><span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">// notice the "long table name" for file Table2.adt. Later open it with "Customer Data" as the table name</span><br /> ? <span style="color: #ff0000;">"Error adding table:"</span>, adsGetLastError<span style="color: #000000;">(</span>@cErr<span style="color: #000000;">)</span>, cErr<br /> <span style="color: #00C800;">ENDIF</span><br /> ? <span style="color: #ff0000;">"Set new admin pword on default connection:"</span>, AdsDDSetDatabaseProperty<span style="color: #000000;">(</span> ADS_DD_ADMIN_PASSWORD, <span style="color: #ff0000;">"newPWord"</span> <span style="color: #000000;">)</span><br /> ? <span style="color: #ff0000;">"Set new admin pword on explicit connection:"</span>, AdsDDSetDatabaseProperty<span style="color: #000000;">(</span> ADS_DD_ADMIN_PASSWORD, <span style="color: #ff0000;">"newPWord"</span>, hConnection1 <span style="color: #000000;">)</span><br /> ? <span style="color: #ff0000;">"Clear admin pword:"</span>, AdsDDSetDatabaseProperty<span style="color: #000000;">(</span> ADS_DD_ADMIN_PASSWORD, <span style="color: #ff0000;">""</span> <span style="color: #000000;">)</span><br /><br /><br /> <span style="color: #00C800;">ELSE</span><br /> ? <span style="color: #ff0000;">"Error connecting to xharbour.add!"</span><br /> <span style="color: #00C800;">ENDIF</span><br /> AdsDisconnect<span style="color: #000000;">(</span>hConnection1<span style="color: #000000;">)</span><br /> hConnection1 := <span style="color: #00C800;">nil</span> <span style="color: #B900B9;">// you should always reset a variable holding a handle that is no longer valid</span><br /><br /> ? <span style="color: #ff0000;">"Default connection is back to 0:"</span>, adsConnection<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ? <span style="color: #ff0000;">"Is a Data Dict connection? (AE_INVALID_HANDLE = 5018):"</span>, AdsGetHandleType<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">// now open the tables and put some data</span><br /><br /> <span style="color: #00C800;">IF</span> AdsConnect60<span style="color: #000000;">(</span><span style="color: #ff0000;">"xharbour.add"</span>, <span style="color: #000000;">7</span><span style="color: #B900B9;">/* All types of connection*/</span>, <span style="color: #ff0000;">"Luiz"</span>, <span style="color: #ff0000;">"papael"</span>, , @hConnection1<span style="color: #000000;">)</span><br /> ? <span style="color: #ff0000;">"Default connection is now this handle:"</span>, adsConnection<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ? <span style="color: #ff0000;">"Connection type?"</span>, AdsGetHandleType<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">FOR</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">100</span><br /> <span style="color: #00C800;">IF</span> AdsCreateSqlStatement<span style="color: #000000;">(</span><span style="color: #ff0000;">"Data2"</span>, <span style="color: #000000;">3</span><span style="color: #000000;">)</span><br /> AdsExecuteSqlDirect<span style="color: #000000;">(</span><span style="color: #ff0000;">" insert into Table1( name,address,city,age) VALUES( '"</span> + strzero<span style="color: #000000;">(</span>n<span style="color: #000000;">)</span>+<span style="color: #ff0000;">"','"</span>+strzero<span style="color: #000000;">(</span>n<span style="color: #000000;">)</span>+<span style="color: #ff0000;">"','"</span>+strzero<span style="color: #000000;">(</span>n<span style="color: #000000;">)</span>+<span style="color: #ff0000;">"',"</span> +str<span style="color: #000000;">(</span>n<span style="color: #000000;">)</span>+ <span style="color: #ff0000;">")"</span> <span style="color: #000000;">)</span><br /> USE<br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">NEXT</span><br /><br /> <span style="color: #00C800;">FOR</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">100</span><br /> <span style="color: #00C800;">IF</span> AdsCreateSqlStatement<span style="color: #000000;">(</span><span style="color: #ff0000;">"Data1"</span>, <span style="color: #000000;">3</span><span style="color: #000000;">)</span><br /> AdsExecuteSqlDirect<span style="color: #000000;">(</span><span style="color: #ff0000;">" insert into "</span> +<span style="color: #ff0000;">'"Customer Data"'</span>+<span style="color: #ff0000;">"( name,address,city,age) VALUES( '"</span>+ strzero<span style="color: #000000;">(</span>n<span style="color: #000000;">)</span>+<span style="color: #ff0000;">"','"</span>+strzero<span style="color: #000000;">(</span>n<span style="color: #000000;">)</span>+<span style="color: #ff0000;">"','"</span>+strzero<span style="color: #000000;">(</span>n<span style="color: #000000;">)</span>+<span style="color: #ff0000;">"',"</span> +str<span style="color: #000000;">(</span>n<span style="color: #000000;">)</span>+<span style="color: #ff0000;">")"</span> <span style="color: #000000;">)</span><br /> USE<br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">NEXT</span><br /><br /><br /> <span style="color: #B900B9;">// AdsUseDictionary(.t.) this function no longer is needed; the system knows if it's using a Data Dictionary connection</span><br /><br /> <span style="color: #B900B9;">// Open the "long table name" for Table2</span><br /> DbUseArea<span style="color: #000000;">(</span>.t.,, <span style="color: #ff0000;">"Customer Data"</span>, <span style="color: #ff0000;">"custom"</span>, .t., .f.<span style="color: #000000;">)</span><br /> ? <span style="color: #ff0000;">"Press a key to browse"</span>, <span style="color: #0000ff;">alias</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> inkey<span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /> Browse<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> USE<br /> USE table1 <span style="color: #00C800;">new</span><br /> Browse<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> USE<br /> <span style="color: #00C800;">ENDIF</span><br /><br /> AdsDisconnect<span style="color: #000000;">(</span>hConnection1<span style="color: #000000;">)</span><br /> @ <span style="color: #000000;">24</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">say</span> <span style="color: #ff0000;">""</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><br /> </div>[/code:3i2jn7xa]
|
ADS and FWC3
|
Does the advantage 16 bit rdd work with FWC3?
|
ADS and FWC3
|
C3 is a 32 bits compiler so you can not use a 16 bits RDD with it.
Also, as fas as we know, there is no ADS RDD 32 bits for it yet.
|
ADS and autoincremental fields
|
Hi,
Is there a way to support it in dbf databases:
[code=fw:5k9tf9ci]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #000000;">{</span> <span style="color: #ff0000;">"ID"</span>, <span style="color: #ff0000;">"+"</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span></div>[/code:5k9tf9ci]
Thank you.
|
ADS and autoincremental fields
|
[quote="MOISES":pmdscnqe]Hi,
Is there a way to support it in dbf databases:
[code=fw:pmdscnqe]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #000000;">{</span> <span style="color: #ff0000;">"ID"</span>, <span style="color: #ff0000;">"+"</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span></div>[/code:pmdscnqe]
Thank you.[/quote:pmdscnqe]
This is already supported in DBFCDX.
fwh\samples\customer.dbf has the first field ID as autoinc field.
|
ADS and autoincremental fields
|
Yes, but I asked in ADS. I get an error: field type not supported.
|
ADS and autoincremental fields
|
this example work with ads
[code=fw:26ob956b]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"common.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"dbinfo.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"ads.ch"</span><br /><br />REQUEST ADS<br /><span style="color: #B900B9;">//REQUEST DBFCDX, DBFFPT</span><br />REQUEST HB_LANG_ESWIN, HB_CODEPAGE_ESWIN<br /><br /><span style="color: #B900B9;">//EXTERNAL OrdKeyNo, OrdKeyCount, OrdKeyGoTo, OrdKeyRelPos</span><br />EXTERNAL AdsKeyNo, AdsKeyCount, AdsGetRelKeyPos, AdsSetRelKeyPos<br /><br />PROCEDURE Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> aStruct := <span style="color: #000000;">{</span> ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"CHARACTER"</span>, <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">25</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"NUMERIC"</span> , <span style="color: #ff0000;">"N"</span>, <span style="color: #000000;">8</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"DOUBLE"</span> , <span style="color: #ff0000;">"N"</span>, <span style="color: #000000;">8</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"DATE"</span> , <span style="color: #ff0000;">"D"</span>, <span style="color: #000000;">8</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"LOGICAL"</span> , <span style="color: #ff0000;">"L"</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"MEMO1"</span> , <span style="color: #ff0000;">"M"</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"MEMO2"</span> , <span style="color: #ff0000;">"M"</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"MYRECNO"</span> , <span style="color: #ff0000;">"+"</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">/*work ok with + and Autoinc*/</span><br /><br /> hb_LangSelect<span style="color: #000000;">(</span> <span style="color: #ff0000;">"ESWIN"</span> <span style="color: #000000;">)</span><br /> hb_SetCodePage<span style="color: #000000;">(</span> <span style="color: #ff0000;">"ESWIN"</span> <span style="color: #000000;">)</span><br /><br /> RddSetDefault<span style="color: #000000;">(</span> <span style="color: #ff0000;">"ADS"</span> <span style="color: #000000;">)</span><br /> <br /> set date brit<br /> set cent <span style="color: #0000ff;">on</span><br /> set opti <span style="color: #0000ff;">on</span><br /> set dele <span style="color: #0000ff;">on</span><br /> <br /> SET <span style="color: #00C800;">SERVER</span> <span style="color: #00C800;">LOCAL</span><br /> SET AXS LOCKING OFF<br /> SET RIGHTS CHECKING OFF<br /> SET CHARTYPE <span style="color: #0000ff;">TO</span> ANSI<br /> SET FILETYPE <span style="color: #0000ff;">TO</span> ADT<br /> <br /> SetMode<span style="color: #000000;">(</span><span style="color: #000000;">25</span>,<span style="color: #000000;">80</span><span style="color: #000000;">)</span><br /> cls<br /> <br /> WAIT <span style="color: #ff0000;">"Exist table: "</span> + iif<span style="color: #000000;">(</span> hb_dbExists<span style="color: #000000;">(</span> <span style="color: #ff0000;">"testdbf"</span> <span style="color: #000000;">)</span>, <span style="color: #ff0000;">"Si"</span>, <span style="color: #ff0000;">"No"</span> <span style="color: #000000;">)</span><br /> <br /> <span style="color: #00C800;">IF</span> !hb_dbExists<span style="color: #000000;">(</span> <span style="color: #ff0000;">"testdbf"</span> <span style="color: #000000;">)</span><br /> DbCreate<span style="color: #000000;">(</span> <span style="color: #ff0000;">"testdbf"</span>, aStruct, <span style="color: #ff0000;">"ADS"</span>, .T., <span style="color: #ff0000;">"mylias"</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">index</span> <span style="color: #0000ff;">on</span> CHARACTER <span style="color: #0000ff;">to</span> char01<br /> <span style="color: #00C800;">ELSE</span><br /> USE testdbf <span style="color: #00C800;">NEW</span> <span style="color: #0000ff;">ALIAS</span> myalias<br /> SET <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">TO</span> char01<br /> WAIT <span style="color: #ff0000;">"IndexOrder: "</span> + hb_ntos<span style="color: #000000;">(</span> OrdNumber<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">" / "</span> + OrdKey<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <br /> Browse<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <br /> use<br /> <br /><span style="color: #00C800;">RETURN</span></div>[/code:26ob956b]
|
ADS and autoincremental fields
|
Thank you very much, Carlos.
The problem occurs if a DBF with autoincremental created with DBFCDX is opened with ADS, then it fails.
We must re-generate the table with the ADS driver.
|
ADS and autoincremental fields
|
yes, not work. ace fail open customer.dbf from fwh sample folder!
[img:1n2iq5jr]https://i.imgur.com/bgFg2zO.png[/img:1n2iq5jr]
|
ADS and autoincremental fields
|
Yes, thats the problem.
It seems that ADS is abandoned by Sybase. Am i right?
|
ADS and time fields [done]
|
Hello,
I would like to know it latest ADS versión, I guess it´s 11, supports Time "T" fields.
Also, what advantages has versión 11 over versión 10?.
Thank you.
|
ADS and time fields [done]
|
Any clue?.
Thanks.
|
ADS and time fields [done]
|
Moises,
ADS support 'TimeStamp' fieldtype.
I'm only using v10
|
ADS and time fields [done]
|
Hello,
I am afraid this sample does not work, it does not créate the dbf:
#include "ads.ch"
REQUEST HB_Lang_ES
REQUEST HB_CODEPAGE_ESWIN
//-------------------------------------------------------------------------------------------------------------
FUNCTION MAIN()
//-------------------------------------------------------------------------------------------------------------
LOCAL aStruct, cFichero, nRet := 0
// Idioma español para Harbour
HB_LangSelect("ES") // Para mensajes, fechas, etc..
HB_CDPSELECT("ESWIN") // Para ordenación, requiere CodePage.lib
REQUEST DBFCDX, DBFFPT
Request ADS,ADSKeyCount,ADSKeyNo,OrdKeyCount,OrdKeyNo, AdsGetRelKeyPos, AdsSetRelKeyPos
RddRegister( "ADS", 1 )
RddSetDefault( "ADS" )
adsSetServerType( 1 ) // ó ADS_LOCAL_SERVER
//setting up the file types
adsSetFileType( ADS_CDX )
// resto de sets
AdsRightsCheck( .F. )
SET DELETED ON
aStruct := { { "NAME", "C", 15, 0 },;
{ "DATE", "D", 08, 0 },;
{ "TIME", "T", 08, 0 },;
{ "TEXTO", "C", 50, 0 } }
cFichero := hb_dirbase() + "MOISES.DBF"
FErase( cFichero )
nRet := DbCreate( cFichero, aStruct ) //, "DBFCDX" )
Alert( "DbCreate() " + cValToChar( nRet ) )
USE &cFichero NEW
APPEND BLANK
REPLACE FIELD->NAME WITH "Test Moises"
REPLACE FIELD->DATE WITH Date()
REPLACE FIELD->TEXTO WITH "Bla bla bla"
DbGoTop()
Browse()
DbCloseAll()
QUIT
RETURN NIL
Any clue?.
Thank you.
|
ADS and time fields [done]
|
Moises,
DBFs are DBFs for ADS too, then for use other data types out of the classic DBF types you need to use ADT tables
regards
Marcelo
|
ADS and time fields [done]
|
Marcelo,
Thanks, but DBFS support this data type field, "T", so DBFS via ADS should also support it.
When changing adsSetFileType to ADSADI, how can I create a table with the timestamp field please?.
|
ADS and time fields [done]
|
Solved,
Not supported and must use ADT tables.
<!-- m --><a class="postlink" href="http://devzone.advantagedatabase.com/forum/questions/5841/rddads-for-harbour-and-xharbour-support-t-fields#fmanswer">http://devzone.advantagedatabase.com/fo ... s#fmanswer</a><!-- m -->
|
ADS attempting to connect to internet.
|
Since yesterday I am receiving a Norton Program Alert:"[b:1eb7555g]MyProgram.exe is attempting to access the Internet...."[/b:1eb7555g]Remote address is: 224.0.1.55 : 2989 (Advantage Extended System)I am using ADS for a few weeks without problem but today I am getting this annoying message.Any suggestion about how to fix this issue?Regards,George
|
ADS attempting to connect to internet.
|
Perhaps Norton allows you to open the specific port or ip where ADS is responding?Reinaldo.
|
ADS clear all locks ?
|
Some times my clients leave locks open on the server ( ADS versions 7 to 9 ), perhaps by Ctrl-Alt-Del or power failure. Then if we try to get an exclusive lock ( ie. reindexing ), it is denied.
I know the lock table is maintained on the server ( Advantage Database Server ? ). Is there a command, or process, we can perform on the server ( other then a full reboot ) that will clear the ADS ( Windows ) lock table of all locks placed by all workstations ?
Tim
|
ADS clear all locks ?
|
Timm,
AdsMgGetLockOwner() indicates wthat user has a locked record into a dbf.
AdsMgGetLocks() indcates all records locked.
You can use AdsMgKillUser() to disconnect a user.
AdsWriteAllRecords() writes all pending data and releases all locks.
Hope it helps.
Regards,
|
ADS clear all locks ?
|
Thank you.
|
ADS cliente/servidor com xHarbour
|
É possível usar ADS cliente/servidor com FiveWin 2.7 + xHarbour.com?
Comprei o ADS 8.0 e pesquisando no fórum encontrei exemplo apenas para Local Server.
Em Clipper faço assim:
# INCLUDE "DBFCDXAX.CH"
//REQUEST DBFCDX
REQUEST DBFCDXAX
DBSETDRIVER('DBFCDXAX')
AX_RightsChecking(.F.)
...
USE CLIENTES INDEX INDCLI // DBF
BROWSE()
...
Em FWH + xHarbour faço como? Usando DBF (cliente/servidor).
Grata.
|
ADS cliente/servidor com xHarbour
|
Eu vi algo na NEWs do xHB sobre um problema no ADS (não lembro qual foi) e junto com a MSG o usuario postou parte do codigo que ele usa para fazer rodar o ADS... talvez ajude Shirley.
|
ADS cliente/servidor com xHarbour
|
Descarga este ejemplo:
<!-- w --><a class="postlink" href="http://www.google.d2g.com/ads/demos/aiswin32.zip">www.google.d2g.com/ads/demos/aiswin32.zip</a><!-- w -->
Es un ejemplo del uso del AIS pero es valido tambien para el ADS remoto
|
ADS cliente/servidor com xHarbour
|
Obrigada Rene,
Consegui indexar a maioria dos arquivos, porém um arquivo que contém campo memo (FPT) mostra o seguinte erro: DBCMD 2001, não encontrei referência deste erro no manual que acompanha o ADS 8.0.
O mais interessante é que consigo abrir o arquivo através do ARC32, localmente, mas não consigo alterar o campo memo. E remotamente não consigo abrir o arquivo, dá o erro 7008 The specified table, memo file, or index file was unable to be opened.
Aparentemente o problema é o campo memo. Como resolver?
Grata.
|
ADS cliente/servidor com xHarbour
|
¿ El campo memo (FPT) esta creado con Clipper o con (x)HB con ADS ?
[quote="syda":2gbhekkz]Obrigada Rene,
Consegui indexar a maioria dos arquivos, porém um arquivo que contém campo memo (FPT) mostra o seguinte erro: DBCMD 2001, não encontrei referência deste erro no manual que acompanha o ADS 8.0.
O mais interessante é que consigo abrir o arquivo através do ARC32, localmente, mas não consigo alterar o campo memo. E remotamente não consigo abrir o arquivo, dá o erro 7008 The specified table, memo file, or index file was unable to be opened.
Aparentemente o problema é o campo memo. Como resolver?
Grata.[/quote:2gbhekkz]
|
ADS cliente/servidor com xHarbour
|
Problema resolvido. Criei uma nova tabela com arc32 e usei Append From com o programa CDBF. Era o campo memo.
Grata.
|
ADS com FW2.8
|
Unresolved External "ADSClosCachedTables" reference Rddads.lib
Unresolved External "HB_FUN__ADS" ...
Atualizei para FW 2.8 e aconteceu estes dois erros.
|
ADS com FW2.8
|
[quote="kbelo":1swsaqii]Unresolved External "ADSClosCachedTables" reference Rddads.lib
Unresolved External "HB_FUN__ADS" ...
Atualizei para FW 2.8 e aconteceu estes dois erros.[/quote:1swsaqii]
Hello
Please use it below:
REQUEST ADS
I guess you should be use REQUEST _ADS
Regards,
Richard
|
ADS com FW2.8
|
[quote="kbelo":19bea8zj]Unresolved External "ADSClosCachedTables" reference Rddads.lib
Unresolved External "HB_FUN__ADS" ...
Atualizei para FW 2.8 e aconteceu estes dois erros.[/quote:19bea8zj]
Agrega:
ACE32.LIB & RDDADS.LIB
A tu proyecto.
|
ADS com FW2.8
|
Estou tentando usar o ADS com Fivewin 2.8
mas esta me aparecendo esta mensagem.
"Não foi possivel localizar o numero ordinal 438 na biblioteca de vinculo dinamico ACE32.DLL"
Alguem pode me auxiliar???
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.