cannot update database

J

Jon

I built a simple form to add data to an excel database. When I try to use it
I get a very simple "Cannot Update Database" error message. Nothing else.
Just those three words. I followed the steps in
http://support.microsoft.com/kb/219974/en-us and it still did not work. I do
have Front Page Extensions installed on my web server. In fact, I have other
..asp pages working just fine on my site. I just can't seem to update add
data to my excel database. Any suggestions.
 
D

David Berry

What is the code you're using to update the database? (Copy and paste
everything from Code View into a reply but remove any user names and
passwords for the database). Also, is the database set to read/write
permissions on the web site? You may have to have your web host check that.
 
S

Stefan B Rusynko

Are you using Excel as in http://support.microsoft.com/default.aspx?scid=268948

PS
You would be better off using Access as your data source

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


|I built a simple form to add data to an excel database. When I try to use it
| I get a very simple "Cannot Update Database" error message. Nothing else.
| Just those three words. I followed the steps in
| http://support.microsoft.com/kb/219974/en-us and it still did not work. I do
| have Front Page Extensions installed on my web server. In fact, I have other
| .asp pages working just fine on my site. I just can't seem to update add
| data to my excel database. Any suggestions.
 
J

Jon

David:

The souce code is attached below. Yes, through the Web Settings in
Frontpage, I've set the parameter for this database to "ReadOnly"=0. In
fact, in the global.asa file, the database is showing as ReadOnly=0. Thanks
for taking the time to review this code:

<%
' FP_ASP ASP Automatically generated by a Frontpage Component. Do not Edit.

On Error Resume Next
Session("FP_OldCodePage") = Session.CodePage
Session("FP_OldLCID") = Session.LCID
Session.CodePage = 1252
Session.LCID = 1033
Err.Clear

strErrorUrl = ""

If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
If Request.Form("VTI-GROUP") = "0" Then
Err.Clear

Set fp_conn = Server.CreateObject("ADODB.Connection")
FP_DumpError strErrorUrl, "Cannot create connection"

Set fp_rs = Server.CreateObject("ADODB.Recordset")
FP_DumpError strErrorUrl, "Cannot create record set"

fp_conn.Open Application("testdata_ConnectionString")
FP_DumpError strErrorUrl, "Cannot open database"

fp_rs.Open "data", fp_conn, 1, 3, 2 ' adOpenKeySet, adLockOptimistic,
adCmdTable
FP_DumpError strErrorUrl, "Cannot open record set"

fp_rs.AddNew
FP_DumpError strErrorUrl, "Cannot add new record set to the database"
Dim arFormFields0(2)
Dim arFormDBFields0(2)
Dim arFormValues0(2)

arFormFields0(0) = "name"
arFormDBFields0(0) = "name"
arFormValues0(0) = Request("name")
arFormFields0(1) = "team"
arFormDBFields0(1) = "team"
arFormValues0(1) = Request("team")

FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0


fp_rs.Update
FP_DumpError strErrorUrl, "Cannot update the database"

fp_rs.Close
fp_conn.Close

FP_FormConfirmation "text/html; charset=windows-1252",_
"Form Confirmation",_
"Thank you for submitting the following information:",_
"testfinal.asp",_
"Return to the form."

End If
End If

Session.CodePage = Session("FP_OldCodePage")
Session.LCID = Session("FP_OldLCID")

%>
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>name</title>
<meta name="Microsoft Border" content="tlb, default">
</head>

<body>

<form method="POST" action="--WEBBOT-SELF--">
<!--webbot bot="SaveDatabase" startspan SuggestedExt="asp"
S-DataConnection="testdata" S-RecordSource="data" S-Form-Fields="name team"
S-Form-DBFields="name team" U-ASP-Include-Url="_fpclass/fpdbform.inc"
--><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--#include
file="_fpclass/fpdbform.inc"--><!--webbot
bot="SaveDatabase" endspan -->
<p>name <input type="text" name="name" size="20"></p>
<p>team <input type="text" name="team" size="20"></p>
<p><input type="submit" value="Submit" name="B1"><input type="reset"
value="Reset" name="B2"></p>
</form>
</body>

</html>
 
J

Jon

One quick note, the error message actually reads, "Cannot Update The Database"

For what it's worth...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top