I'm looking for a way a user can click a button and going to the
internet site which is stored into a database.
The database contains a fieldname NetHTTP (character) which
represent a company internet-adres/site.
The user wants to double-click-left-button when he's on the
field NetHTTP, so Netscape or IE will start and connect to
the internet page.
I'm looking for a solution for Vdb5 and Vdb7...
Thanks....
Peter
You can modify this to handle either. This is by Romain Streiff.
/* ----------------------------------------------------------------
OpenURL -- opens a browser with the URL you pass to it.
Posted by Romain Strieff on the VdBASE Newsgroups
----------------------------------------------------------------
*/
function OpenURL( cURL )
if type( "ShellExecute" ) # "FP"
extern cHandle ShellExecute( cHandle, cString, cString, ;
cString, cString, cINT ) shell32 ;
from "ShellExecuteA"
endif
ShellExecute( 0, "open", cURL, null, null, 1 )
(This is the VdBASE 7 version -- if you are using VdBASE 5.x, remove
the "32" from "shell" and the "A" from "ShellExecuteA").
By the way, this news group is dead. You should post all questions in
the NEW news groups hosted by dBASE Inc. Below my signature is a link to
their news server.
--
Geoff Wass ( dBVIPS )
Kuala Lumpur, Malaysia
=>=> More dBASE info at http://members.theglobe.com/Geoff_Wass <=<=
*>*> Visit the NEW! dBASE Inc. news groups on the news server
news://news.dbase2000.com <*<*
> Peter,
>
> You can modify this to handle either. This is by Romain Streiff.
>
> /* ----------------------------------------------------------------
> OpenURL -- opens a browser with the URL you pass to it.
> Posted by Romain Strieff on the VdBASE Newsgroups
>
> ----------------------------------------------------------------
> */
> function OpenURL( cURL )
> if type( "ShellExecute" ) # "FP"
> extern cHandle ShellExecute( cHandle, cString, cString, ;
> cString, cString, cINT ) shell32 ;
> from "ShellExecuteA"
> endif
>
> ShellExecute( 0, "open", cURL, null, null, 1 )
>
> (This is the VdBASE 7 version -- if you are using VdBASE 5.x, remove
> the "32" from "shell" and the "A" from "ShellExecuteA").
>
> By the way, this news group is dead. You should post all questions in
> the NEW news groups hosted by dBASE Inc. Below my signature is a link
> to
> their news server.
>
Geoff,
I used this procedure and it works, but I only got it working on the
command prompt when
I'm using this syntax : OpenUrl("http://www.novell.com")
I'm looking for a way I could use a value from a field which is on the
form to connect to
the internet. I have used the following syntax but I don't get it
working:
* The form contains the entryfield NetHTTP where the internet page is
stored, so :
* I declare the value form Form.Entryfield_NetHTTP to the var. cURL
cURL=Form.Entryfield_NetHTTP.Value
OpenUrl(cURL)
VDB will now display the message 'Datatype mismatch: Expecting
character"
Where am I going wrong....can't you use the cURL variable ?
Greetings Peter
> * The form contains the entryfield NetHTTP where the internet page is
> stored, so :
> * I declare the value form Form.Entryfield_NetHTTP to the var. cURL
> cURL=Form.Entryfield_NetHTTP.Value
> OpenUrl(cURL)
>
> VDB will now display the message 'Datatype mismatch: Expecting
> character"
>
> Where am I going wrong....can't you use the cURL variable ?
Your code looks like it should work, assuming the two lines above are
inside the same function/procedure, and that that function/procedure
is between the CLASS/ENDCLASS statements of the form. You might want
to double check for typo's. If that all looks right, try:
cURL=Form.Entryfield_NetHTTP.Value
msgbox( "cURL = " + cURL + chr(13) + ;
"Data type is: "+type( cURL) )
OpenUrl(cURL)
Note that for the TYPE() function to work, cURL must be PRIVATE, or
PUBLIC. This should NOT be required for the function to work, so you
may want to change it to a PRIVATE for debugging purposes and then
change it back to LOCAL once it's working.
Please move to the dBASE2000 News Groups at
news://news.dbase2000.com
as soon as possible The groups here will close very soon.
Gary White [dBVIPS]
Some dBASE Stuff at
http://www.AppTools.com/dbase