I wanted to know if this was possible. Hope I'm asking this question the right way.
Can you write SELECT query locally without using the server? I can connect using certificate key and MySQL workbench but can't connect to the database on the server using the same credentials.
I'm using Php but don't know any other way to SELECT table and retrieve data for my React application without writing code on the server in a Php file to access the data?
Related
Trying to execute a SQL Server stored procedure on a server using codeigniter but it seems that the query doesn't get any output and no error prompts either, for now I've removed the parameters thinking that it will smooth things up but it didn't.
Is it possible to access this stored procedure and if it is, can I also run it with parameters like two date parameters?
PS: All the connections are good I've tried to retrieve records from another table from this SQL Server and I got it..
I am trying to setup remote access to the data of Sage 100 Advanced ERP for use within a website running on a MySQL database. I only need to get inventory levels for products, so it's a read-only application.
As I understand it, Sage 100 comes with an ODBC driver that can allow remote access to Sage's flat-file data storage by creating a database view. What I need to do is copy a few fields from that data on the Sage server over to the web server hosting the website.
To automate this process, I assume I'll need to setup a cron job on the web server that runs a PHP script (preferred language) executing SQL queries that connect to the remote server, extract the needed data, and write it to the appropriate tables in the MySQL database. I'm fine with that last step, but I'm unsure of the steps to connect and retrieve data from the ODBC data source.
How can I connect to and extract Sage 100 data from an ODBC Data Source to write to a MySQL Database on another server?
Or, is there a way to sync/mirror the ODBC Data Source to a MySQL Database on a separate server that I could then use to copy data over to the website's database?
Note: MySQL has documentation on pulling data FROM MySQL using ODBC, but no info on how to import data TO MySQL using ODBC on an external server.
It's actually very easy. Just establish an ODBC connection to the SOTAMAS90 DSN. Your connection string looks like this:
"DSN=SOTAMAS90; UID=MyUserId; PWD=MyPassword; Company=ABC"
Note that by default Sage installs a 32-bit version of the driver, which means you must target your application to 32 bits. Or you can install the 64-bit version of the driver, which can be found in your Sage directory, in the WKSetup folder.
After that just write code to SELECT * from each of the tables you need, and write them into your MySql database.
I don't really know MySql well, but in SQL Server you can set up a Linked Server, point it to SOTAMAS90, and then query the SQL Server database instead of the ODBC driver. But it's slow. Much better performance if you can run a nightly ETL to populate your MySQL database and query that. Be sure to set foreign keys and create indexes for them after to define the tables.
Hope that helps.
Aaron
I need to automate a data flow from MS-Access to MySQL for an insurance company.
Users will continue to work in MS-Access, but the changes done through the Access forms should take effect in MySQL as well.
This is the decision of our web analyst, because the web system will not be able to replace all MS-Access functionalities that are currently used, and the data management will currently continue to be done in MS-Access (this was the decision).
I see two options, and one of the options contains my question:
Automate the data upload through VBA (when changes occur via the form, an Ajax request sends the data via GET parameters to a PHP script on the server that performs the necessary manipulations on the data before storing them in MySQL. Immediate upload into MySQL could have been possible as well, but it was decided not to do this);
Send a simple request to a PHP script, and perform all actions in PHP: Get records from MS-Access in PHP, manipulate the data in PHP, and store them to MySQL in PHP. (My preference. I will need to create a script that runs automatic migrations every night as well, so I will need to do this anyway).
The MS-Access database is stored on our local network, ie. a different server than where the PHP script runs (which is an external web server).
I would prefer to manage everything in PHP, but (my question):
Is it possible to connect to the host of our local network and the
host of the external server simultaneously, querying data from
MS-Access, manipulating them with PHP and inserting / updating them in MySQL at the
same time, in a single script?
Is it possible to connect to the host of our local network and the
host of the external server simultaneously, querying data from
MS-Access, manipulating them with PHP and inserting / updating them in
MySQL at the same time, in a single script?
Yes, but you don't really need a PHP script, access can work with MySQL through an ODBC connection or by using ADODB connections. It would be easiest to modify the forms to work with the MYSQL back-end.
The advantage of the ODBC connection is you can insert from the access DB to the MySQL DB in a single query.
Using ADODB connections you can take an access query, and do a batch insert (you'll have to do it through a string), but that can also be relatively quick since you only connect to the MySQL db to send the INSERT command, the rest is string manipulation.
If you are going to go with an asynchronous bulk update through php
<?php
$dbName = $_SERVER["DOCUMENT_ROOT"] . "products\products.mdb";
if (!file_exists($dbName)) {
die("Could not find database file.");
}
$db = new PDO("odbc:DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=$dbName; Uid=; Pwd=;");
That code will allow you to connect to the access back-end (credit to http://www.sitepoint.com/using-an-access-database-with-php/)
note that the queries will be parsed by access, so you should format them the access way.
I am looking for a way to export a mysql table into MS Access file using php. The server is windows based and I want to export all the data in my mysql table into a msaccess file. I know about mysql to csv to mbd conversion(using phpmyadmin and ms access s/w), but is there a easy and better way to convert the tables into access file say on a mouse click using php?
Please note that there are lots records in the mysql table
Thanks for the help in advance.
There are a couple of ways to do this. I'd probably just connect Access directly to the MySQL DB as described here. I'm assuming, though, that this is not an option for you.
Assuming you can't do that for whatever reason you can always put together a script to connect to both the MySQL and MSAccess databases via PHP+SQL. This link has a guide to connecting to an Access DB via PHP.
I have access to a remote Oracle database when using Toad or SQL Developer.
The connection is specified by a TNS record and user+password of course.
Now I wish to have a local webpage that shows (regularly refreshed) data from the database. At first I was thinking of using php but I guess that can only be used on the server itself and I am unable to create files on the server. Of course a server page would be more suitable when there's multiple users but here there's only one.
In fact I just want to do the same as is done by running queries from the tools mentioned, but now called from a custom webpage. I feel this should be possible because the tool has to establish the connection from client to server db also; but I don't know how to set up my local client webpage(s).
Is this possible by applying php or javascript if that's more suitable?
Well you have to understand that the functionality of connecting to oracle database is packaged as part of frameworks, there are no such frameworks in javascript which can help you.
you are right with php, however it needs a webserver to run and they are free :)
the reason why php can connect to oracle database is, it has the framework to do those operations.
for now the answer is no.
or you can see if you can write an Activex which can connect to Oracle database and refresh, microsoft provides framework / api to connect to databases
The best way to do that kind of thing is AJAX: a javascript code calls a PHP page on the web server, this page connects to the DB and returns data to the javascript that updates the page.