PDA

View Full Version : Visual BAsic, MySQL, and Host


Qill
09-30-2002, 08:33 PM
VB cant connect to most hosts MySQL databases. Has anyone tried writing a PHP middleman program, so VB can talk to the database through the PHP program?

firepages
10-01-2002, 03:27 AM
Hi, bit confused here ... most hosts with MySQL will be *NIX so VB aint gonna be available, the ones running MS servers (IIS) should have MyODBC or similar installed in which case you should be able to make a regular DSN connection ?

you could possibly create a PHP page that takes an SQL query as an argument via the URL ?Q=SELECT blah blah etc and call that via VB I suppose, but how you get any returned data back to your calling app I dont know (I mean you can write the data to file etc but its a real painful way of doing things)

Its also possible to write a web-service in PHP using XMLRPC for example but I do not know enough of how VB works to know if and how you would go about setting this up..

Qill
10-01-2002, 10:02 AM
Hmm... Ok thanks :(

Alekz
10-01-2002, 10:50 AM
Hi,
It's interesting though... SOAP could be response...

Alex

Qill
10-01-2002, 01:04 PM
SOAP?

Alekz
10-01-2002, 01:11 PM
SOAP = Simple Object Access Protocol. A form of RPC - XML based...
You describe the request as XML - Class, Method, parameters and get the result of execution again as XML... Basically...

Alex

Qill
10-01-2002, 06:06 PM
Ok thanks. I checked that out, and even though I have no idea what XML is or what SOAP is, it looks like the sort of thing that might work. I should be able to figure it out like I do everything else: Trial and Error :(

whackaxe
10-01-2002, 07:10 PM
what is so googd about SOAP? i keep seeing it around and still havent got whats so good

Qill
10-01-2002, 08:18 PM
Catchy name I guess. Too complicated for me.

firepages
10-02-2002, 01:44 AM
what is so good about SOAP?

depends who you ask and why tou ask ;)

I develop 99% of my stuff in PHP, so if I want 2 servers or applicatons to talk to each other or allow remote queries from other apps that I have control of then SOAP / XML-RPC is pointless for me as its much quicker for me (to write and employ) simple communication devices using PHP and sockets and use serialised objects for transport of the data.

Its much faster to parse a native data format than to parse XML data for example.

BUT, if I want other people to be able to access this service or data and they are using say ASP or CFM then its a no-brainer for me to produce XML output and let them worry about parsing the returned data. (XML they can get at easily - serialised PHP objects they may have problems reproducing)

thats only half of it of course, in a web-service you would be giving incoming requests an API to access etc with methods that they can access etc , but at its lowest level a simple service need be (for the example above)no more than a page that takes a query as an argument and returns the query results, of course thats not very secure (but nor is (so I hear) the MS SOAP spec :))