从Access中调用远程PHP脚本? [英] Calling a remote PHP script from within Access?

查看:52
本文介绍了从Access中调用远程PHP脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以从Access中调用远程php脚本?我在想

类似于:


DoCMD ... http://www.domain.com/scripts/dataquery.php

DoCmd.OpenQuery" update_data",acNormal ,acEdit

.....


因此PHP脚本在服务器数据库上执行某些操作,然后在链接时执行

在访问中查看表,数据发生了变化吗?


问题是,ODBC对于某些事情来说太慢了,如果我可以调用一个php

脚本并让它在服务器上运行更激烈的数据查询,它会更快。


这可能吗?

Is it possible to call a remote php script from within Access? I''m thinking
something like:

DoCMD... http://www.domain.com/scripts/dataquery.php
DoCmd.OpenQuery "update_data", acNormal, acEdit
.....

So the PHP script does something on the server database, then when a linked
table is viewed within access, the data changes have been made?

The problem is, ODBC is too slow for certain things and if I can call a php
script and have it run the more intense data queries on the server, it''d be
a lot faster.

Is this possible?

推荐答案

你有点混合苹果和橘子(我想)。我在网络服务器上运行ASP和JSP

。我相信PHP是一回事。假设您的数据服务器是Oracle或Microsoft Sql Server,我是
。在

中,您可以使用ADO来调用数据上的存储过程

数据库。这将是获得结果集的最快方法。你可以从一个网页,ASP,JSP,

PHP调用存储过程,这是真的,但这可能是一种不合理的行为。你问你是否可以从Access调用PHP命令,这就像使用send

键在你的网页上输入一些内容(假设浏览器已启动并且

正在运行)。如果你想在幕后做这件事(最合乎逻辑的选择),ADO就是这样做的。您可以直接从Access进行操作。

只需在工具/参考中引用MDAC2.6即可。但是,这将与PHP没有任何关系。 PHP和

之间的唯一交互我可以想到的是将数据从PHP写入Access或从Access访问PHP读取数据。如果我完全不在这里,

希望有人会纠正我。


Rich


***通过开发人员指南 http://www.developersdex.com 发送***

不要只是参加USENET ......获得奖励!
You are sort of mixing apples and oranges (I think). I do ASP and JSP
which operate in web servers. I believe PHP is the same thing. I am
assuming your data server is either Oracle or Microsoft Sql Server. In
either case you can use ADO to invoke stored procedures on your data
Databases. That would be the fastest way to get a result set. It is
true that you can invoke stored procedures from a webpage, ASP, JSP,
PHP, but that would be a hands on ineraction. You are asking if you
could invoke the PHP command from Access, that would be like using send
keys to type something in your webpage (assuming the browser is up and
running). If you want to do this behind the scenes (most logical
choice), ADO is the way to do. This you can do straight from Access.
Just make a reference to MDAC2.6 in tools/References. But this would
not have anything to do with PHP. The only interaction between PHP and
Access I could think of would be to write data to Access from the PHP or
read data from Access to the PHP. If I am completely off base here,
hopefully someone will correct me.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!


我应该更清楚。有一个运行Apache / PHP / MySQL的Web服务器,其中包含Web数据所需的
。但是在桌面上,他们使用镜像

数据集进行访问,并将表格链接到网络服务器以保持网站上线

到目前为止。


问题是,通过

MySQL'的myodbc运行大型DELETE或INSERT查询是如此之慢,我只想访问一个PHP脚本/页面

至少会删除必要的记录并让访问权限来处理剩余的
。将处理时间缩短一半。


所以对php脚本的调用就像
http://whatever.com/script.php?id=1

可以在后台运行,不需要打开网络浏览器等。


php将运行并删除ID = 1的所有记录。那将是

几乎立即发生在服务器。然后访问可以运行它的更新或

插入查询并将记录上传到Web服务器。


这有意义吗?从理论上来说听起来很简单,如果它在访问中无法完成
,我会感到惊讶。既然它是服务器上的MySQL数据库,我可能不会使用ADO ---对吧?


Rich P < RP ***** @ aol.com>在消息中写道

news:3f ********************* @ news.frii.net ...
I should be more clear. There''s a web server running Apache/PHP/MySQL where
the web data resides. But on the desktop they have Access with a mirrored
set of data and also linked tables to the web server to keep the web site up
to date.

The problem is, it''s so slow running large DELETE or INSERT queries via
MySQL''s myodbc that I''d like to simply have access call to a php script/page
that would at least delete the necessary records and let access take care of
the rest. Cutting the process time in half.

So the call to the php script would simply be something like
http://whatever.com/script.php?id=1
that could run in the background, not require opening a web browser, etc.

php would run through and delete all records where ID = 1. That would
happen almost instantly on the server. Then access could run it''s update or
insert query and being to upload the records to the web server.

Does that make sense? In theory is sounds simple and I''d be surprised if it
couldn''t be done in access. Since it''s a MySQL database on the server, I
probably can''t use ADO --- right?

"Rich P" <rp*****@aol.com> wrote in message
news:3f*********************@news.frii.net...
你有点混合苹果和橘子(我想)。我做ASP和JSP
在Web服务器上运行。我相信PHP是一回事。我假设您的数据服务器是Oracle或Microsoft Sql Server。在这两种情况下,您都可以使用ADO来调用数据库上的存储过程。这将是获得结果集的最快方法。确实,你可以从网页,ASP,JSP,PHP中调用存储过程,但这可能是一种不合理的行为。您在询问是否可以从Access调用PHP命令,这就像使用send
键在您的网页中键入内容(假设浏览器已启动并且正在运行)。如果你想在幕后做这件事(最合乎逻辑的选择),ADO就是这样做的。您可以直接从Access进行操作。
只需在工具/参考中引用MDAC2.6即可。但这与PHP没有任何关系。我想到的PHP和
Access之间的唯一交互是从PHP写入数据到Access或从Access到PHP读取数据。如果我完全不在这里,
希望有人会纠正我。

Rich

***通过Developersdex发送 http://www.developersdex.com ***
不要只是参加USENET ......获得奖励对于它!
You are sort of mixing apples and oranges (I think). I do ASP and JSP
which operate in web servers. I believe PHP is the same thing. I am
assuming your data server is either Oracle or Microsoft Sql Server. In
either case you can use ADO to invoke stored procedures on your data
Databases. That would be the fastest way to get a result set. It is
true that you can invoke stored procedures from a webpage, ASP, JSP,
PHP, but that would be a hands on ineraction. You are asking if you
could invoke the PHP command from Access, that would be like using send
keys to type something in your webpage (assuming the browser is up and
running). If you want to do this behind the scenes (most logical
choice), ADO is the way to do. This you can do straight from Access.
Just make a reference to MDAC2.6 in tools/References. But this would
not have anything to do with PHP. The only interaction between PHP and
Access I could think of would be to write data to Access from the PHP or
read data from Access to the PHP. If I am completely off base here,
hopefully someone will correct me.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!



你不能使用PASS THROUGH查询吗?


P

" jj" < jj@test.net>在消息中写道

news:qh ******************* @ twister.rdc-kc.rr.com ...
Can''t you use a PASS THROUGH query?

P
"jj" <jj@test.net> wrote in message
news:qh*******************@twister.rdc-kc.rr.com...
我应该更清楚。有一个Web服务器运行Apache / PHP / MySQL
,其中包含Web数据。但是在桌面上,他们使用镜像数据集访问Access,并将表链接到Web服务器,以使网站保持最新状态。

问题是,通过MySQL的myodbc运行大型DELETE或INSERT查询是如此之慢,我只想访问一个至少删除必要的php
脚本/页面的访问权限记录并让访问保持其余的
。将处理时间减少一半。

因此,对php脚本的调用就像
http://whatever.com/script.php?id=1
可以在后台运行,不需要打开网页浏览器,等等。

php会运行并删除ID = 1的所有记录。这几乎会立即在服务器上发生。然后访问可以运行它的更新
或插入查询并将记录上传到Web服务器。

这有意义吗?理论上听起来很简单,如果
无法在访问中完成,我会感到惊讶。由于它是服务器上的MySQL数据库,我可能不会使用ADO ---对吧?

Rich P < RP ***** @ aol.com>在消息中写道
新闻:3f ********************* @ news.frii.net ...
I should be more clear. There''s a web server running Apache/PHP/MySQL where the web data resides. But on the desktop they have Access with a mirrored
set of data and also linked tables to the web server to keep the web site up to date.

The problem is, it''s so slow running large DELETE or INSERT queries via
MySQL''s myodbc that I''d like to simply have access call to a php script/page that would at least delete the necessary records and let access take care of the rest. Cutting the process time in half.

So the call to the php script would simply be something like
http://whatever.com/script.php?id=1
that could run in the background, not require opening a web browser, etc.

php would run through and delete all records where ID = 1. That would
happen almost instantly on the server. Then access could run it''s update or insert query and being to upload the records to the web server.

Does that make sense? In theory is sounds simple and I''d be surprised if it couldn''t be done in access. Since it''s a MySQL database on the server, I
probably can''t use ADO --- right?

"Rich P" <rp*****@aol.com> wrote in message
news:3f*********************@news.frii.net...
你是混合苹果和橘子(我想)。我做ASP和JSP
在Web服务器上运行。我相信PHP是一回事。我假设您的数据服务器是Oracle或Microsoft Sql Server。在这两种情况下,您都可以使用ADO来调用数据库上的存储过程。这将是获得结果集的最快方法。确实,你可以从网页,ASP,JSP,PHP中调用存储过程,但这可能是一种不合理的行为。您在询问是否可以从Access调用PHP命令,这就像使用send
键在您的网页中键入内容(假设浏览器已启动并且正在运行)。如果你想在幕后做这件事(最合乎逻辑的选择),ADO就是这样做的。您可以直接从Access进行操作。
只需在工具/参考中引用MDAC2.6即可。但这与PHP没有任何关系。我想到的PHP和
Access之间的唯一交互是从PHP写入数据到Access或从Access到PHP读取数据。如果我完全不在这里,
希望有人会纠正我。

Rich

***通过Developersdex发送 http://www.developersdex.com ***
不要只是参加USENET ......获得奖励为它!
You are sort of mixing apples and oranges (I think). I do ASP and JSP
which operate in web servers. I believe PHP is the same thing. I am
assuming your data server is either Oracle or Microsoft Sql Server. In
either case you can use ADO to invoke stored procedures on your data
Databases. That would be the fastest way to get a result set. It is
true that you can invoke stored procedures from a webpage, ASP, JSP,
PHP, but that would be a hands on ineraction. You are asking if you
could invoke the PHP command from Access, that would be like using send
keys to type something in your webpage (assuming the browser is up and
running). If you want to do this behind the scenes (most logical
choice), ADO is the way to do. This you can do straight from Access.
Just make a reference to MDAC2.6 in tools/References. But this would
not have anything to do with PHP. The only interaction between PHP and
Access I could think of would be to write data to Access from the PHP or
read data from Access to the PHP. If I am completely off base here,
hopefully someone will correct me.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!




这篇关于从Access中调用远程PHP脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆