473,699 Members | 2,203 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calling a remote PHP script from within Access?

jj
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_dat a", 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?

Nov 12 '05 #1
14 9046
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!
Nov 12 '05 #2
jj
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.co m> wrote in message
news:3f******** *************@n ews.frii.net...
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!

Nov 12 '05 #3
Can't you use a PASS THROUGH query?

P
"jj" <jj@test.net> wrote in message
news:qh******** ***********@twi ster.rdc-kc.rr.com...
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.co m> wrote in message
news:3f******** *************@n ews.frii.net...
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!


Nov 12 '05 #4
jj
I tried that and oh wow that was fast!!

Weird, it's using the same ODBC driver yet on takes 2 seconds via
pass-through, same statement via normal query takes 10-15 minutes.
Thanks!
"Phobos" <la******@spamm ers.co.uk> wrote in message
news:KN******** ************@br ightview.com...
Can't you use a PASS THROUGH query?

P
"jj" <jj@test.net> wrote in message
news:qh******** ***********@twi ster.rdc-kc.rr.com...
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.co m> wrote in message
news:3f******** *************@n ews.frii.net...
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!



Nov 12 '05 #5
jj
The only strange thing is, if I leave it to default ODBC; and I select the
ODBC DSN when running the query, it works fine. When I use the ... build
connection method and try to store the connection info, I get an error back
about it not being to find the connection or table.

It's almost acting like there are too many characters in the field or
something.

Is there a trick to getting this to work? I'd like to have this process
automated and NOT have to select the ODBC DSN every time they run the query.

Thanks!
"Phobos" <la******@spamm ers.co.uk> wrote in message
news:KN******** ************@br ightview.com...
Can't you use a PASS THROUGH query?

P
"jj" <jj@test.net> wrote in message
news:qh******** ***********@twi ster.rdc-kc.rr.com...
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.co m> wrote in message
news:3f******** *************@n ews.frii.net...
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!



Nov 12 '05 #6
jj" <jj@test.net> wrote in message
news:Rn******** **********@twis ter.rdc-kc.rr.com...
I tried that and oh wow that was fast!!

Weird, it's using the same ODBC driver yet on takes 2 seconds via
pass-through, same statement via normal query takes 10-15 minutes.
That's because PASS THROUGH queries run on the server instead of over the
network.
Thanks!
You're welcome.
"Phobos" <la******@spamm ers.co.uk> wrote in message
news:KN******** ************@br ightview.com...
Can't you use a PASS THROUGH query?

Nov 12 '05 #7
"jj" <jj@test.net> wrote in message
news:Gu******** **********@twis ter.rdc-kc.rr.com...
The only strange thing is, if I leave it to default ODBC; and I select the
ODBC DSN when running the query, it works fine. When I use the ... build
connection method and try to store the connection info, I get an error back about it not being to find the connection or table.
Strange, are you sure that your connection string is correct?

Also, read the help files as pass-through queries can be a bit
temperamental.

Thanks!


You're welcome.

P
Nov 12 '05 #8
jj
Here's what it creates in the ODBC Connect Str field:
ODBC;DSN=XXXX;D ESC=MySQL ODBC 3.51 Driver
DSN;DATABASE=de velop;SERVER=11 1.111.111.118;U ID=develop;PASS WORD=pass223;PO R
T=3306;OPTION=3 ;STMT=;

Does that look right?

The error it returns is:
The Microsoft Jet database engine cannot find the input table or query
'ODBC;DSN=XXXX; DESC=MySQL ODBC 3.51 Driver DSN;DATABASE=de velop;SE'. Make
sure it exists and that its name is spelled correctly.
Hmmm.... it's like it's reading the connection string as the query?

"Phobos" <la******@spamm ers.co.uk> wrote in message
news:xo******** ************@br ightview.com...
"jj" <jj@test.net> wrote in message
news:Gu******** **********@twis ter.rdc-kc.rr.com...
The only strange thing is, if I leave it to default ODBC; and I select the ODBC DSN when running the query, it works fine. When I use the ... build connection method and try to store the connection info, I get an error

back
about it not being to find the connection or table.


Strange, are you sure that your connection string is correct?

Also, read the help files as pass-through queries can be a bit
temperamental.

Thanks!


You're welcome.

P

Nov 12 '05 #9
To automate ODBC connections in Access you can use the TableDef object.
First Drop (delete) the ODBC table. Then

Dim tdf As TableDef
Set tdf = Currentdb.Table Defs("yourODBCt bl")
tdf.Connect = "ODBC;DSN=ODBCd snInControlPann el;UID=joe;PWD= shmo"
tdf.SourceTable Name = "NameOfSourceTb lLinkingTo"
CurrentDB.Table Defs.Append tdf

Rich

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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2901
by: steve | last post by:
Hi, I finally figured out the best way to synch local and remote script folders, containing many php script files. What I used to do before was try to ftp all the changed files, etc. which was tedious and often broke. It was also very slow. What I do now is to pkzip the folder up, ftp the pkzip’ed data to remote, and then unzip it there, which recreates the directories and files.
4
2822
by: Razzbar | last post by:
I need to be able to conditionally load a remote script, using the "<script src=..." syntax. Or some other way. I've seen people writing about using the document.write method, but it's not working like I want it to. What's happening is, if I do a document.write(scriptcall), the script loads, although sometimes very slowly... (?). Any inline code is executed (I used an alert to verify that the script is loading). But all the previous...
9
4465
by: Karl Irvin | last post by:
Does anyone have an example of an FTP script or module for use with Access 2003. I need to send a file from by computer to my web host from within Access. The from folder may or may not be the folder where I Shell to FTP The to folder on the host is not the default folder I am using: Shell(ftp.exe -s: & script variable)
1
2020
by: Tim Hunter | last post by:
Hi, I am using Access 2003 with WinXP/sp#2. I have built a Help file using MS HTML Help Workshop that includes a TOC as well as an Index file. My problem is how do I call this from Access. I do not want to set up Context Sensitive Help I want to open an intact Help file similar to a Windows Help File. I have tried everything I know, obviously not much, but all I can generate is Context Sensitive Help w/o TOC or and Index.
1
1939
by: clteh9 | last post by:
There is no error or exception for the code below. It works fine with the calc.exe. But it fails when i call the script. For your information, strScript is the remote script and strFileName is the arguments that passed in to the remote script. May i know anything wrong to the source code below. Thanks public void InvokeRemoteScript(string strScript, string strFileName) { if(this.m_mgmtScope != null && this.m_mgmtScope.IsConnected) {
3
3253
by: johnny | last post by:
I have a remote script on a local network and I need to make Web App in PHP, call this remote script on a different machine. How do I do this? Many Thanks.
5
18215
by: Normann | last post by:
Ok I have been searching for days now, so I hope there is someone here who can help me. Is there anyway to call a sql script from within a sql script under MS SQL-Server 2005, i.e. a master install script calls a number of smaller scripts to fill out the tables.
1
1765
by: bbammes | last post by:
I'm writing a click tracking program which calls a remote PHP script when a user clicks a link. My javascript is: <script type="text/javascript"> //<! ); ?>&clientaddress=<?php echo urlencode( $_SERVER ); ?>"; } return true; } //]]>
1
1477
by: AngieMP | last post by:
Hi Guys I have inherited an Access DB in a very poorly state! I have offered to make some changes to it for a local charity but have got stuck on this error it seems to be creating for all new records. I am working within a Form which is calling another Form matched on the ID, this is within Access 2000. Clicking the cmdLinkExistingCaredFor_Click produces an Error 6: Overflow error. Can anyone help me as to what maybe making the code...
0
8703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8623
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9185
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8935
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8893
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6540
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5879
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2359
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.