Quantcast
Channel: SCN: Message List - SAP Advantage Database Server
Viewing all 997 articles
Browse latest View live

connecting to ADS with php

$
0
0

I am testing ADS and I fail to connect using php. Actually they cannot use the client on the Linux machine the web server is running. The php module is installed

 

php -i | grep -i adv
advantage
Advantage Version => 11.10.0.1
Advantage Support => enabled
advantage.allow_persistent => On => On
advantage.check_persistent => On => On
advantage.default_db => no value => no value
advantage.default_pw => <i>no value</i> => <i>no value</i>
advantage.default_user => no value => no value
advantage.defaultbinmode => return as is => return as is
advantage.defaultlrl => return up to 4096 bytes => return up to 4096 bytes
advantage.max_links => Unlimited => Unlimited
advantage.max_persistent => Unlimited => Unlimited

patientlink:/home/patientlink/public_html# php -i | grep -i pdo
/etc/php5/cli/conf.d/pdo.ini,
/etc/php5/cli/conf.d/pdo_dblib.ini,
/etc/php5/cli/conf.d/pdo_mysql.ini,
/etc/php5/cli/conf.d/pdo_odbc.ini,
/etc/php5/cli/conf.d/pdo_sqlite.ini,
PDO
PDO support => enabled
PDO drivers => dblib, mysql, odbc, sqlite, sqlite2
pdo_dblib
PDO Driver for FreeTDS/Sybase DB-lib => enabled
pdo_mysql
PDO Driver for MySQL => enabled
PDO_ODBC
PDO Driver for ODBC (unixODBC) => enabled
pdo_sqlite
PDO Driver for SQLite 3.x => enabled

 

and in the manual we find this example  http://devzone.advantagedatabase.com/dz/webhelp/Advantage11/index.html?php_advantage_pdo_driver.htm

<?PHP

   

$pdoDBH = new PDO( "advantage:Data Source=//server:6262/share/;ServerType=Remote;" );

$pdoDBH->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );

$pdostmtStatement = $pdoDBH->query( "select * from testtable" );

$iNumRows = $pdostmtStatement->rowCount();

$aArray = $pdostmtStatement->fetchAll( PDO::FETCH_ASSOC );

print_r( $aArray );

$pdostmtStatement->closeCursor();

$pdoDBH = null;

?>

 


where we should change the server address and provide credentials. The ADS server is version 9 running on a windows machine and if I use this

79.129.39.53c\webdata\DATA\LIS.add

username : adssys

password: labadmin

 

I can connect from either the machine the server is running or another windows machine, but not from linux

 

it is an old version because there is a potential customer who has already built an application on this version and requests to prove him php connectivity, however I can only download latest clients.

1) I suppose since client 11 is connecting from windows it can also connect from Linux

2)need help to configure php, I am afraid I am not well aware of either php and ADS and probably I am asking something really trivial

 

 

Thank you in advance


Re: connecting to ADS with php

$
0
0

The client (php) is using the following version

Advantage Version => 11.10.0.1

 

You have indicated the server is version 9.  Unfortunately a newer client can not connect to an older server.  You will  need to either downgrade the client to version 9 or upgrade the server to version 11.1 

 

Edgar

Re: connecting to ADS with php

$
0
0

Thank you very much for this. We continue using same versions on client and server

 

Kimon

using ADS local server on Linux

$
0
0

Hi,

 

I am using Centos 6.4 and I've installed unixODBC and downloaded and installed the Sybase Advantage ODBC driver for Linux version 11.1.  I unpacked and installed the driver (using setup.pl).

 

I created the following /etc/odbc.ini

 

;

; odbc.ini

;

[ODBC Data Sources]

Odie = Advantage ODBC Driver

 

[Odie]

Driver=/usr/lib64/libadsodbc.so

DataDirectory=/usr/src

Description=Advantage ODBC driver

DefaultType=FoxPro

ServerTypes=1

 

I'm trying to access FoxPro DBF files, and I'm wanting to use the Advantage Local Server to do so.  I copied a FoxPro free table called test.dbf to /usr/src.  The file /usr/lib64/libadsloc.so exists in the same folder as /usr/lib64/libadsodb.so.  Then from the command prompt, I ran --

 

isql Odie -v

 

And I got the following error --

 

[root@linuxmysql2 adsodbc-11.10.0.1]# isql Odie -v

[S1000][unixODBC][iAnywhere Solutions][Advantage SQL][ASA] Error 6060:  Advantage Database Server not available on specified server.  axServerConnect

[ISQL]ERROR: Could not SQLConnect

 

I understand that the Advantage Local Server for Linux is not a daemon, so there's nothing that's supposed to be running.  Given that I configured "ServerTypes=1" and the libadsloc.so file appears to be in the correct place, so I'm sure I'm doing something wrong, but I'm not quite sure what.

 

Suggestions?

 

UPDATE :

 

Upon further investigation, I've figured out how to get past that particular error by creating an /etc/ads.ini and putting in the following --

 

[SETTINGS]
ADS_SERVER_TYPE=1

 

But now I'm getting the message I've copied below when trying to run "select * from test". /usr/src/test.dbf exists and is chmod 777 just to simplify things. As you can see in my ODBC setup above, my data directory is /usr/src. This is a free table, and no FoxPro database exists, nor does an Advantage database exist. The same thing works fine on my Windows box.

 

SQL> select * from test
[S1000][unixODBC][iAnywhere Solutions][Advantage SQL][ASA] Error 7200: AQE Error: State = HY000; NativeError = 5004; [iAnywhere Solutions][Advantage SQL][ASA] Error 5004: Either ACE could not find the specified file, or you do not have sufficient rights to access the file. //linuxmysql2/usr/src/test.adt Table name: test
[ISQL]ERROR: Could not SQLPrepare

 

UPDATE 2:

I tried specifically indicating the full file name (including .dbf at the end) and I got the following error --

 

SQL> select * from [test.dbf]
[S1000][unixODBC][iAnywhere Solutions][Advantage SQL][ASA] Error 7200: AQE Error:  State = HY000;   NativeError = 7016;  [iAnywhere Solutions][Advantage SQL][ASA] Error 7016:  Corrupt table.  Make sure you are not attempting to open a DBF with an ADT table type or vice versa.  //linuxmysql2/usr/src/test.dbf Table name: test.dbf
[ISQL]ERROR: Could not SQLPrepare

 

I've specified the default table type in odbc.ini, but it looks like that may be getting ignored.  If I don't specify the table extension, it complains that test.adt doesn't exist.  If I do, then it complains that I'm trying to open a DBF as an ADT table, even though I've specified that I want to be opening DBFs.

Re: using ADS local server on Linux

$
0
0

Hi,

 

I believe that we may have answered this on the Q&A forum.  If I recall correctly, you placed the odbc.ini in your local home directory as .odbc.ini and this seemed to resolve the issues.

 

Edgar

Re: Not able to create schema in Sybase databae

$
0
0

Sam,

 

  It sounds like you are using our SQL Anywhere database and not Advantage Database server.

 

  In this case the Test5 user needs to have CREATE rights or be the Owner of the database. I would recommend you take a look at our tutorial on Creating a SQL Anywhere Database.

 

  You can also log into your databse using the DBA account and assign the Ownership to your test5 user. All of the documetation for SQL Anywhere can be found at http://dcx.sybase.com

Re: Not able to create schema in Sybase databae

$
0
0

Database version is SAP Sybase Adaptive Server Enterprise 15.7

 

Thank you,

Sam

ASE instance not available *** ERROR:ASE instance possibly left running when system went down(system crash?). Notify Database Administrator

$
0
0

Hi Gurus,

 

I made some changes in rz10 for client copy like:


icm/host_name_full eccdev@kljindia.com

login/accept_sso2_ticket 1

login/create_sso2_ticket 2

icm/server_port_1

PROT=HTTPS,PORT=443$$,PROCTIMEOUT=600,TIMEOUT=600

icm/server_port_0

PROT=HTTP,PORT=80$$,PROCTIMEOUT=600,TIMEOUT=600

login/no_automatic_user_sapstar 0


After to make changes effective, i stopsap & startsap.


But unfortunately db is not coming up. I checked startdb.log it showing

error as " ASE instance not available

*** ERROR:ASE instance possibly left running when system

went down(system crash?).

Notify Database Administrator."


Please help us to resolve this issue, i have also added startdb.log for

your reference.

 

 

 

Regards,

 

Piyush


Re: ASE instance not available *** ERROR:ASE instance possibly left running when system went down(system crash?). Notify Database Administrator

$
0
0

Hi Piyush -

 

This community is for ADS (Advantage Database Server) and not ASE.  Please post this question to the ASE community.

 

Thanks,

Mike

How can we export the Primary key values (along with other data) from an Advantage database?

$
0
0

One of our customers is moving from our application (which uses Advantage Database Server) to another application (which uses other database technology). They have asked us to help export their data, so that they can migrate it to another database system. So far, we have used the Advantage Data Architect (ARC32) "Export Table Structures as Code" functionality to generate SQL. We used the "Include existing data" option. The SQL contains the necessary code to recreate the tables and indexes. The customer's IT staff will alter the SQL statements as necessary for their new system.

 

However, there is an issue with the Primary Keys in these table. The resulting INSERT statements use AutoInc as the type for the Primary Key in each Table. These INSERT statements contains "DEFAULT" for the value of each of these AutoInc fields. The customer would like to output an integer value for each of these Primary Key values in order to maintain referential integrity in their new system.

 

So far, I have not found any feature of ARC32 that allows us to export the Primary Key values. We had been using an older version of ARC32, since our application does not use the latest version of ADS. I did download the latest version of ARC32 (11.10), but it does not appear to include any new functionality that would facilitate doing this sort of export.

 

  1. Can somebody tell me if there is such a feature in ARC32?
  2. Or, is there is another Advantage tool to facilitate what we are trying to accomplish?
  3. If there are no Advantage tools to provide such functionality, what else would you suggest?

Re: How can we export the Primary key values (along with other data) from an Advantage database?

$
0
0

George,

 

  It sounds like the approach you are using is the correct one. This seems to be the cleanest solution to me especially since the customer is able to modify the generated SQL statements for their new system.

 

  In order to preserve the AutoInc values I would recommend altering the table and changing the field datatype from AutoInc to Integer. Then export the table as code which will export the actual values. After the tables have been created on the new system they can change the field datatype back to an AutoInc type if necessary.

 

Regards,

 

Chris Franz

Disable Auto Inc Enforcement

$
0
0

Is it possible to temporarily disable autoinc insert.  I have a client who's accidentally deleted some records from a very large table and we would like to replace them with the original Id value.

 

As we can disable triggers, can we disable AutoInc?

 

Thanks

 

John

Re: Disable Auto Inc Enforcement

$
0
0

Hi John,

 

There is an API AdsDisableAutoIncEnforcement http://devzone.advantagedatabase.com/dz/WebHelp/Advantage11.1/index.html?ace_adsdisableautoincenforcement.htm

 

Unfortunately There is not really an easy way to call this API without writing a small program.  (If you do use this API and combine it with SQL, you might check out this  KB http://devzone.advantagedatabase.com/dz/content.aspx?Key=17&RefNo=110407-2410)

 

As an alternative, you might consider altering the table to change the AutoInc to an Integer, insert the rows needed and then alter back to AutoInc.

 

Edgar

Re: Disable Auto Inc Enforcement

$
0
0

Hi Edgar

 

Thanks for the reply.

 

In the past I have temporarily altered the field type to Integer but it requires all users to be out of the system or it carries a risk if other new records get added around the same time.

 

Another one for my wish list.

 

Kind regards

 

John

Re: ASE instance not available *** ERROR:ASE instance possibly left running when system went down(system crash?). Notify Database Administrator

$
0
0

Hi Piyush,

 

Did you solved this issue.

 

We are facing the same issue and only this thread is there in SCN for this issue.

If you solved this issue,Kindly share the solution.

 

Thanks and Regards,

Mathan A


Advantage Database Server 11.1 under Windows Server 2012 R2

$
0
0

Hello,

 

runs the Advantage Database Server under Windows Server 2012 R2 and is it supported.

 

Thanks,

 

Andy

Re: Advantage Database Server 11.1 under Windows Server 2012 R2

$
0
0

Hi Andy,

 

This document outlines the supported platforms for Advantage Database Server.

 

Windows Server 2008 R2 is a supported platform for 11.1.

 

Thanks,

Mikel

database table vs free table???

Re: database table vs free table???

$
0
0

Are you getting an error message when you try to access the table? If you have made a successful connection to the dictionary the table type should not matter.

ISAM Error 2004

$
0
0

Hi there

 

Can anyone please tell me what this undocumented error is about in the Architect in ADS 11.

 

AQE Error: State = S0000; NativeError = 2004; [iAnywhere  Solutions] Advantage SQL Engine] [ISAM]ISAM error]

 

It's happening  on a Windows 8.1 machine when copying data from a table in one database to a table of the same name in a linked database.

 

It's a process I've done many times before on other machines, and if I run the select portion of the script then I get all the data, so it does look like an issue with the insert stage.  Folder permissions look fine.

 

Any help would be appreciated.

 

Thanks

 

John

Viewing all 997 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>