Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error adding data to dbf with POST through FoxISAPI

Status
Not open for further replies.

ontsjc

Technical User
May 17, 2000
113
Hello,

I'm writing a small web app (mainly to learn the use of FoxISAPI) that will display pictures on a website, let people vote for a picture and log that vote in a dbf. Just for test purposes, I have placed all the files in one directory and given it full permssions. Everything works fine until I call the method that opens the dbf. When I call that I get following error:

FOXISAPI call failed
Progid is: TFoxServer.TFoxIsapi

Method is: savepars

Parameters are:

parameters are: picture1=Pic1&picture2=Pic2&employeenum=037104

Invoke failed with err code 80020009: Exception occurred.



all this current method is doing is saving the web page form parameters in their native state to a memo field in a dbf so I can look at how they are passed over. Here's the html code:

<html>
<body>

<form action="foxisapi.dll/TFoxServer.TFoxIsapi.savepars"
method="POST">
<table>
<tr>
<td><img src="/images/pics/mountain_stream.jpg" width="400" height="300"><br>
Vote:
<input type="checkbox" name="picture1" value="Pic1" /></td>
<td><img src="/images/pics/tcreek2.jpg" width="400" height="300"><br>
Vote:
<input type="checkbox" name="picture2" value="Pic2" /></td>
</tr>
</table>
Enter Employee Number:
<input type="text" name="employeenum">
<input type="submit" value="Submit">

</form>

</body>
</html>

And here is the server method code:

*** System Defines
#DEFINE CR CHR(13)+CHR(10)

DEFINE CLASS TFoxISAPI AS Custom OLEPUBLIC

***************************************************************************
FUNCTION Helloworld
LPARAMETER lcFormVars, lcIniFile, lnReleaseFlag
LOCAL lcOutput


lcOutput="HTTP/1.0 200 OK"+CR+;
"Content-type: text/html"+CR+CR

lcOutput=lcOutput+;
"<HTML><BODY>"+CR+;
"<H1>Hello World from Visual FoxPro</H1><HR>"+CR+;
"This page was generated by Visual FoxPro, lcFormVars are...<HR>"+lcFormVars+CR+;
"</HTML></BODY>"

RETURN lcOutput



*********************************************************
FUNCTION savepars
LPARAMETER lcFormVars, lcIniFile, lnReleaseFlag

USE "c:\projects\datamgmt\servertest\strdata.dbf" IN 0 shared
SELECT strdata
APPEND BLANK
replace Strdata.formvars WITH lcFormVars
USE IN strdata

lcOutput="HTTP/1.0 200 OK"+CR+;
"Content-type: text/html"+CR+CR

lcOutput=lcOutput+;
"<HTML><BODY>"+CR+;
"<H1>Hello World from Visual FoxPro</H1><HR>"+CR+;
"This page was generated by Visual FoxPro, lcFormVars are...<HR>"+lcFormVars+CR+;
"</HTML></BODY>"

RETURN lcOutput
ENDDEFINE

Thanks for any help you can provide.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top