Error Adding Record with INSERT INTO

W

William McFarland

Using FrontPage 2003
WIndows XP
Office 2003
Website on a Windows 2003 Server

Receiving the following error when trying to add a record to a database
using INSERT INTO in a custom query.

Database Results Wizard Error
Your page contains a query with user input parameters that could not be
resolved.
This could happen if your DatabaseRegionStart webbot has an empty or missing
s-columnnames or s-columntypes attributes.
You may need to read Microsoft Knowledge Base Article 817029.

Query in Database results file that receives POST is

INSERT INTO Disbursements ( GranteeNum, ContractNum )
VALUES ( = '::GranteeNum::', = '::ContractNum::' )

FP will only accept the code when I replace the "::" with "%%". When I look
at query after saving file, FP re-writes, replacing "%%" with "::" but then
reports errors in the query.

GranteeNum and ContractNum are the textbox names from the form posting. Data
is entered into the textbox as text through a database results wizard form.

Can anyone assist with the correct syntax?
 
J

Jon Spivey

Looks like your insert is wrong, shouldn't be and = in an insert.
INSERT INTO Disbursements ( GranteeNum, ContractNum )
VALUES ('::GranteeNum::', '::ContractNum::' )

Also make sure the datatypes are correct - the above would work if both
fields are text. if either/both are numeric lose the quotes.

Cheers,
Jon
 
W

William McFarland

Jon, thanks for the reply.

DRW reports a syntax error - missing operand when I try code as you
suggested. This is what lead me to trying the = sign.
 
J

Jon Spivey

Hi,
I'm not sure what to suggest - that sql should work all day long. Both of
the fields are text right? Why not try hard coding some values into the
insert - this should help us figure out if the problem is on the
sql/database side or the form field values. Try something like

INSERT INTO Disbursements (GranteeNum, ContractNum)
VALUES ('Test 1', 'Test 2')

and let us know what happens

Cheers,
Jon
 
W

William McFarland

Jon,

The hard coding worked. On the form field side, the names are correct. The
form fields are being populated by another database results call that is
inside of a form which posts the information to the page that contains the
query.
 

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

Similar Threads


Top